(0) Obligation:

Clauses:

bid(Hand, Attributes, Points, Bid) :- ','(sort_hand(Hand, SortedHand), ','(evaluate(SortedHand, Attributes, Points), make_bid(SortedHand, Attributes, Points, Bid))).
evaluate(Hand, [], P) :- ','(hcp(Hand, 0, HCP), ','(adjustments(Hand, MP), is(P, +(HCP, MP)))).
adjustments(X1, 0).
make_bid(Hand, Attributes, Points, 'punt...').
hcp([], N, N).
hcp(.(=(_X, C), Sn), Ni, No) :- ','(hcp_suit(C, N), ','(is(Nt, +(N, Ni)), hcp(Sn, Nt, No))).
hcp_suit(S, P) :- ','(honors(S, 0, HP), ','(dist(S, DP), ','(misc(S, MP), is(P, +(HP, +(DP, MP)))))).
honors([], Pi, Pi).
honors(.(C1, Cn), Pi, Po) :- ','(honor(C1, P), ','(>(P, 0), ','(is(Pt, +(P, Pi)), honors(Cn, Pt, Po)))).
honors(.(C1, Cn), Pi, Pi) :- honor(C1, 0).
honor(C, N) :- face_card(C, N).
honor(C, 0) :- integer(C).
face_card(ace, 4).
face_card(king, 3).
face_card(queen, 2).
face_card(jack, 1).
dist([], 3).
dist(.(X2, []), 2).
dist(.(X3, .(X4, [])), 1).
dist(.(X5, .(X6, .(X7, X8))), 0).
misc(.(ace, []), -1).
misc(.(king, []), -2).
misc(.(queen, .(X9, [])), -2).
misc(.(jack, .(X10, [])), -1).
misc(.(_X, .(_Y, .(H3, Rem))), P) :- ','(honor(H3, X), ','(>(X, 0), ','(length(Rem, N), ','(>(N, 2), is(P, -(N, 2)))))).
misc(X11, 0).
sort_hand(Hand, SortedHand) :- ','(split_suits(Hand, SplitHand), sort_suits(SplitHand, SortedHand)).
split_suits(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) :- ','(filter(Hand, spades, S), ','(filter(Hand, hearts, H), ','(filter(Hand, diamonds, D), filter(Hand, clubs, C)))).
filter([], X12, []).
filter(.(-(Card, Suit), In), Suit, .(Card, Out)) :- filter(In, Suit, Out).
filter(.(-(_A, X), In), Suit, Out) :- ','(\==(Suit, X), filter(In, Suit, Out)).
sort_suits([], []).
sort_suits(.(=(S, Ci), In), .(=(S, Co), Out)) :- ','(i_sort(Ci, [], Co), sort_suits(In, Out)).
i_sort([], L, L).
i_sort(.(C1, Cn), Li, Lo) :- ','(insert(C1, Li, Lt), i_sort(Cn, Lt, Lo)).
insert(X, [], .(X, [])).
insert(X, .(Y, Z), .(X, .(Y, Z))) :- higher(X, Y).
insert(X, .(Y, Z), .(Y, L)) :- ','(lower(X, Y), insert(X, Z, L)).
higher(ace, X13).
higher(king, X) :- \==(X, ace).
higher(queen, X) :- ','(\==(X, ace), \==(X, king)).
higher(jack, X) :- integer(X).
higher(jack, jack).
higher(X, Y) :- ','(integer(X), ','(integer(Y), >=(X, Y))).
lower(king, ace).
lower(queen, X) :- ','(honor(X, N), >(N, 2)).
lower(jack, X) :- ','(honor(X, N), >(N, 1)).
lower(X, Y) :- ','(integer(X), honor(Y, _M)).
lower(X, Y) :- ','(integer(X), ','(integer(Y), <(X, Y))).
goal :- bid(.(-(ace, clubs), .(-(3, hearts), .(-(4, spades), .(-(4, diamonds), .(-(king, clubs), .(-(jack, hearts), .(-(ace, spades), .(-(ace, hearts), .(-(10, clubs), .(-(9, clubs), .(-(6, clubs), .(-(queen, diamonds), .(-(king, spades), []))))))))))))), Attr, Pts, Bid).

Query: bid(g,a,a,a)

(1) UndefinedPredicateHandlerProof (SOUND transformation)

Added facts for all undefined predicates [PROLOG].

(2) Obligation:

Clauses:

bid(Hand, Attributes, Points, Bid) :- ','(sort_hand(Hand, SortedHand), ','(evaluate(SortedHand, Attributes, Points), make_bid(SortedHand, Attributes, Points, Bid))).
evaluate(Hand, [], P) :- ','(hcp(Hand, 0, HCP), ','(adjustments(Hand, MP), is(P, +(HCP, MP)))).
adjustments(X1, 0).
make_bid(Hand, Attributes, Points, 'punt...').
hcp([], N, N).
hcp(.(=(_X, C), Sn), Ni, No) :- ','(hcp_suit(C, N), ','(is(Nt, +(N, Ni)), hcp(Sn, Nt, No))).
hcp_suit(S, P) :- ','(honors(S, 0, HP), ','(dist(S, DP), ','(misc(S, MP), is(P, +(HP, +(DP, MP)))))).
honors([], Pi, Pi).
honors(.(C1, Cn), Pi, Po) :- ','(honor(C1, P), ','(>(P, 0), ','(is(Pt, +(P, Pi)), honors(Cn, Pt, Po)))).
honors(.(C1, Cn), Pi, Pi) :- honor(C1, 0).
honor(C, N) :- face_card(C, N).
honor(C, 0) :- integer(C).
face_card(ace, 4).
face_card(king, 3).
face_card(queen, 2).
face_card(jack, 1).
dist([], 3).
dist(.(X2, []), 2).
dist(.(X3, .(X4, [])), 1).
dist(.(X5, .(X6, .(X7, X8))), 0).
misc(.(ace, []), -1).
misc(.(king, []), -2).
misc(.(queen, .(X9, [])), -2).
misc(.(jack, .(X10, [])), -1).
misc(.(_X, .(_Y, .(H3, Rem))), P) :- ','(honor(H3, X), ','(>(X, 0), ','(length(Rem, N), ','(>(N, 2), is(P, -(N, 2)))))).
misc(X11, 0).
sort_hand(Hand, SortedHand) :- ','(split_suits(Hand, SplitHand), sort_suits(SplitHand, SortedHand)).
split_suits(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) :- ','(filter(Hand, spades, S), ','(filter(Hand, hearts, H), ','(filter(Hand, diamonds, D), filter(Hand, clubs, C)))).
filter([], X12, []).
filter(.(-(Card, Suit), In), Suit, .(Card, Out)) :- filter(In, Suit, Out).
filter(.(-(_A, X), In), Suit, Out) :- ','(\==(Suit, X), filter(In, Suit, Out)).
sort_suits([], []).
sort_suits(.(=(S, Ci), In), .(=(S, Co), Out)) :- ','(i_sort(Ci, [], Co), sort_suits(In, Out)).
i_sort([], L, L).
i_sort(.(C1, Cn), Li, Lo) :- ','(insert(C1, Li, Lt), i_sort(Cn, Lt, Lo)).
insert(X, [], .(X, [])).
insert(X, .(Y, Z), .(X, .(Y, Z))) :- higher(X, Y).
insert(X, .(Y, Z), .(Y, L)) :- ','(lower(X, Y), insert(X, Z, L)).
higher(ace, X13).
higher(king, X) :- \==(X, ace).
higher(queen, X) :- ','(\==(X, ace), \==(X, king)).
higher(jack, X) :- integer(X).
higher(jack, jack).
higher(X, Y) :- ','(integer(X), ','(integer(Y), >=(X, Y))).
lower(king, ace).
lower(queen, X) :- ','(honor(X, N), >(N, 2)).
lower(jack, X) :- ','(honor(X, N), >(N, 1)).
lower(X, Y) :- ','(integer(X), honor(Y, _M)).
lower(X, Y) :- ','(integer(X), ','(integer(Y), <(X, Y))).
goal :- bid(.(-(ace, clubs), .(-(3, hearts), .(-(4, spades), .(-(4, diamonds), .(-(king, clubs), .(-(jack, hearts), .(-(ace, spades), .(-(ace, hearts), .(-(10, clubs), .(-(9, clubs), .(-(6, clubs), .(-(queen, diamonds), .(-(king, spades), []))))))))))))), Attr, Pts, Bid).
is(X0, X1).
>(X0, X1).
integer(X0).
length(X0, X1).
\==(X0, X1).
>=(X0, X1).
<(X0, X1).

Query: bid(g,a,a,a)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
bid_in: (b,f,f,f)
sort_hand_in: (b,f)
split_suits_in: (b,f)
filter_in: (b,b,f)
sort_suits_in: (b,f)
i_sort_in: (b,b,f)
insert_in: (b,b,f)
higher_in: (b,b)
lower_in: (b,b)
honor_in: (b,f) (b,b)
evaluate_in: (b,f,f)
hcp_in: (b,b,f) (b,f,f)
hcp_suit_in: (b,f)
honors_in: (b,b,f) (b,f,f)
misc_in: (b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

BID_IN_GAAA(Hand, Attributes, Points, Bid) → U1_GAAA(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
BID_IN_GAAA(Hand, Attributes, Points, Bid) → SORT_HAND_IN_GA(Hand, SortedHand)
SORT_HAND_IN_GA(Hand, SortedHand) → U26_GA(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
SORT_HAND_IN_GA(Hand, SortedHand) → SPLIT_SUITS_IN_GA(Hand, SplitHand)
SPLIT_SUITS_IN_GA(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_GA(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
SPLIT_SUITS_IN_GA(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → FILTER_IN_GGA(Hand, spades, S)
FILTER_IN_GGA(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_GGA(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
FILTER_IN_GGA(.(-(Card, Suit), In), Suit, .(Card, Out)) → FILTER_IN_GGA(In, Suit, Out)
FILTER_IN_GGA(.(-(_A, X), In), Suit, Out) → U33_GGA(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
FILTER_IN_GGA(.(-(_A, X), In), Suit, Out) → \==_IN_GG(Suit, X)
U33_GGA(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_GGA(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U33_GGA(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → FILTER_IN_GGA(In, Suit, Out)
U28_GA(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_GA(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U28_GA(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → FILTER_IN_GGA(Hand, hearts, H)
U29_GA(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_GA(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U29_GA(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → FILTER_IN_GGA(Hand, diamonds, D)
U30_GA(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_GA(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U30_GA(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → FILTER_IN_GGA(Hand, clubs, C)
U26_GA(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_GA(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
U26_GA(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → SORT_SUITS_IN_GA(SplitHand, SortedHand)
SORT_SUITS_IN_GA(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_GA(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
SORT_SUITS_IN_GA(.(=(S, Ci), In), .(=(S, Co), Out)) → I_SORT_IN_GGA(Ci, [], Co)
I_SORT_IN_GGA(.(C1, Cn), Li, Lo) → U37_GGA(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
I_SORT_IN_GGA(.(C1, Cn), Li, Lo) → INSERT_IN_GGA(C1, Li, Lt)
INSERT_IN_GGA(X, .(Y, Z), .(X, .(Y, Z))) → U39_GGA(X, Y, Z, higher_in_gg(X, Y))
INSERT_IN_GGA(X, .(Y, Z), .(X, .(Y, Z))) → HIGHER_IN_GG(X, Y)
HIGHER_IN_GG(king, X) → U42_GG(X, \==_in_gg(X, ace))
HIGHER_IN_GG(king, X) → \==_IN_GG(X, ace)
HIGHER_IN_GG(queen, X) → U43_GG(X, \==_in_gg(X, ace))
HIGHER_IN_GG(queen, X) → \==_IN_GG(X, ace)
U43_GG(X, \==_out_gg(X, ace)) → U44_GG(X, \==_in_gg(X, king))
U43_GG(X, \==_out_gg(X, ace)) → \==_IN_GG(X, king)
HIGHER_IN_GG(jack, X) → U45_GG(X, integer_in_g(X))
HIGHER_IN_GG(jack, X) → INTEGER_IN_G(X)
HIGHER_IN_GG(X, Y) → U46_GG(X, Y, integer_in_g(X))
HIGHER_IN_GG(X, Y) → INTEGER_IN_G(X)
U46_GG(X, Y, integer_out_g(X)) → U47_GG(X, Y, integer_in_g(Y))
U46_GG(X, Y, integer_out_g(X)) → INTEGER_IN_G(Y)
U47_GG(X, Y, integer_out_g(Y)) → U48_GG(X, Y, >=_in_gg(X, Y))
U47_GG(X, Y, integer_out_g(Y)) → >=_IN_GG(X, Y)
INSERT_IN_GGA(X, .(Y, Z), .(Y, L)) → U40_GGA(X, Y, Z, L, lower_in_gg(X, Y))
INSERT_IN_GGA(X, .(Y, Z), .(Y, L)) → LOWER_IN_GG(X, Y)
LOWER_IN_GG(queen, X) → U49_GG(X, honor_in_ga(X, N))
LOWER_IN_GG(queen, X) → HONOR_IN_GA(X, N)
HONOR_IN_GA(C, N) → U19_GA(C, N, face_card_in_ga(C, N))
HONOR_IN_GA(C, N) → FACE_CARD_IN_GA(C, N)
HONOR_IN_GA(C, 0) → U20_GA(C, integer_in_g(C))
HONOR_IN_GA(C, 0) → INTEGER_IN_G(C)
U49_GG(X, honor_out_ga(X, N)) → U50_GG(X, >_in_gg(N, 2))
U49_GG(X, honor_out_ga(X, N)) → >_IN_GG(N, 2)
LOWER_IN_GG(jack, X) → U51_GG(X, honor_in_ga(X, N))
LOWER_IN_GG(jack, X) → HONOR_IN_GA(X, N)
U51_GG(X, honor_out_ga(X, N)) → U52_GG(X, >_in_gg(N, 1))
U51_GG(X, honor_out_ga(X, N)) → >_IN_GG(N, 1)
LOWER_IN_GG(X, Y) → U53_GG(X, Y, integer_in_g(X))
LOWER_IN_GG(X, Y) → INTEGER_IN_G(X)
U53_GG(X, Y, integer_out_g(X)) → U54_GG(X, Y, honor_in_ga(Y, _M))
U53_GG(X, Y, integer_out_g(X)) → HONOR_IN_GA(Y, _M)
U53_GG(X, Y, integer_out_g(X)) → U55_GG(X, Y, integer_in_g(Y))
U53_GG(X, Y, integer_out_g(X)) → INTEGER_IN_G(Y)
U55_GG(X, Y, integer_out_g(Y)) → U56_GG(X, Y, <_in_gg(X, Y))
U55_GG(X, Y, integer_out_g(Y)) → <_IN_GG(X, Y)
U40_GGA(X, Y, Z, L, lower_out_gg(X, Y)) → U41_GGA(X, Y, Z, L, insert_in_gga(X, Z, L))
U40_GGA(X, Y, Z, L, lower_out_gg(X, Y)) → INSERT_IN_GGA(X, Z, L)
U37_GGA(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_GGA(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U37_GGA(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → I_SORT_IN_GGA(Cn, Lt, Lo)
U35_GA(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_GA(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U35_GA(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → SORT_SUITS_IN_GA(In, Out)
U1_GAAA(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_GAAA(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
U1_GAAA(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → EVALUATE_IN_GAA(SortedHand, Attributes, Points)
EVALUATE_IN_GAA(Hand, [], P) → U4_GAA(Hand, P, hcp_in_gga(Hand, 0, HCP))
EVALUATE_IN_GAA(Hand, [], P) → HCP_IN_GGA(Hand, 0, HCP)
HCP_IN_GGA(.(=(_X, C), Sn), Ni, No) → U7_GGA(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
HCP_IN_GGA(.(=(_X, C), Sn), Ni, No) → HCP_SUIT_IN_GA(C, N)
HCP_SUIT_IN_GA(S, P) → U10_GA(S, P, honors_in_gga(S, 0, HP))
HCP_SUIT_IN_GA(S, P) → HONORS_IN_GGA(S, 0, HP)
HONORS_IN_GGA(.(C1, Cn), Pi, Po) → U14_GGA(C1, Cn, Pi, Po, honor_in_ga(C1, P))
HONORS_IN_GGA(.(C1, Cn), Pi, Po) → HONOR_IN_GA(C1, P)
U14_GGA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_GGA(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U14_GGA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → >_IN_GG(P, 0)
U15_GGA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_GGA(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
U15_GGA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → IS_IN_AG(Pt, +(P, Pi))
U16_GGA(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_GGA(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
U16_GGA(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → HONORS_IN_GAA(Cn, Pt, Po)
HONORS_IN_GAA(.(C1, Cn), Pi, Po) → U14_GAA(C1, Cn, Pi, Po, honor_in_ga(C1, P))
HONORS_IN_GAA(.(C1, Cn), Pi, Po) → HONOR_IN_GA(C1, P)
U14_GAA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_GAA(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U14_GAA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → >_IN_GG(P, 0)
U15_GAA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_GAA(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
U15_GAA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → IS_IN_AA(Pt, +(P, Pi))
U16_GAA(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_GAA(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
U16_GAA(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → HONORS_IN_GAA(Cn, Pt, Po)
HONORS_IN_GAA(.(C1, Cn), Pi, Pi) → U18_GAA(C1, Cn, Pi, honor_in_gg(C1, 0))
HONORS_IN_GAA(.(C1, Cn), Pi, Pi) → HONOR_IN_GG(C1, 0)
HONOR_IN_GG(C, N) → U19_GG(C, N, face_card_in_gg(C, N))
HONOR_IN_GG(C, N) → FACE_CARD_IN_GG(C, N)
HONOR_IN_GG(C, 0) → U20_GG(C, integer_in_g(C))
HONOR_IN_GG(C, 0) → INTEGER_IN_G(C)
HONORS_IN_GGA(.(C1, Cn), Pi, Pi) → U18_GGA(C1, Cn, Pi, honor_in_gg(C1, 0))
HONORS_IN_GGA(.(C1, Cn), Pi, Pi) → HONOR_IN_GG(C1, 0)
U10_GA(S, P, honors_out_gga(S, 0, HP)) → U11_GA(S, P, HP, dist_in_ga(S, DP))
U10_GA(S, P, honors_out_gga(S, 0, HP)) → DIST_IN_GA(S, DP)
U11_GA(S, P, HP, dist_out_ga(S, DP)) → U12_GA(S, P, HP, DP, misc_in_ga(S, MP))
U11_GA(S, P, HP, dist_out_ga(S, DP)) → MISC_IN_GA(S, MP)
MISC_IN_GA(.(_X, .(_Y, .(H3, Rem))), P) → U21_GA(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
MISC_IN_GA(.(_X, .(_Y, .(H3, Rem))), P) → HONOR_IN_GA(H3, X)
U21_GA(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_GA(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U21_GA(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → >_IN_GG(X, 0)
U22_GA(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_GA(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
U22_GA(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → LENGTH_IN_GA(Rem, N)
U23_GA(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_GA(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
U23_GA(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → >_IN_AG(N, 2)
U24_GA(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_GA(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U24_GA(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → IS_IN_AA(P, -(N, 2))
U12_GA(S, P, HP, DP, misc_out_ga(S, MP)) → U13_GA(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U12_GA(S, P, HP, DP, misc_out_ga(S, MP)) → IS_IN_AA(P, +(HP, +(DP, MP)))
U7_GGA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_GGA(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U7_GGA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → IS_IN_AA(Nt, +(N, Ni))
U8_GGA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_GGA(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U8_GGA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → HCP_IN_GAA(Sn, Nt, No)
HCP_IN_GAA(.(=(_X, C), Sn), Ni, No) → U7_GAA(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
HCP_IN_GAA(.(=(_X, C), Sn), Ni, No) → HCP_SUIT_IN_GA(C, N)
U7_GAA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_GAA(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U7_GAA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → IS_IN_AA(Nt, +(N, Ni))
U8_GAA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_GAA(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U8_GAA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → HCP_IN_GAA(Sn, Nt, No)
U4_GAA(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_GAA(Hand, P, HCP, adjustments_in_ga(Hand, MP))
U4_GAA(Hand, P, hcp_out_gga(Hand, 0, HCP)) → ADJUSTMENTS_IN_GA(Hand, MP)
U5_GAA(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_GAA(Hand, P, is_in_aa(P, +(HCP, MP)))
U5_GAA(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → IS_IN_AA(P, +(HCP, MP))
U2_GAAA(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_GAAA(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
U2_GAAA(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → MAKE_BID_IN_GGAA(SortedHand, Attributes, Points, Bid)

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
BID_IN_GAAA(x1, x2, x3, x4)  =  BID_IN_GAAA(x1)
U1_GAAA(x1, x2, x3, x4, x5)  =  U1_GAAA(x5)
SORT_HAND_IN_GA(x1, x2)  =  SORT_HAND_IN_GA(x1)
U26_GA(x1, x2, x3)  =  U26_GA(x3)
SPLIT_SUITS_IN_GA(x1, x2)  =  SPLIT_SUITS_IN_GA(x1)
U28_GA(x1, x2, x3, x4, x5, x6)  =  U28_GA(x1, x6)
FILTER_IN_GGA(x1, x2, x3)  =  FILTER_IN_GGA(x1, x2)
U32_GGA(x1, x2, x3, x4, x5)  =  U32_GGA(x1, x5)
U33_GGA(x1, x2, x3, x4, x5, x6)  =  U33_GGA(x3, x4, x6)
\==_IN_GG(x1, x2)  =  \==_IN_GG(x1, x2)
U34_GGA(x1, x2, x3, x4, x5, x6)  =  U34_GGA(x6)
U29_GA(x1, x2, x3, x4, x5, x6)  =  U29_GA(x1, x2, x6)
U30_GA(x1, x2, x3, x4, x5, x6)  =  U30_GA(x1, x2, x3, x6)
U31_GA(x1, x2, x3, x4, x5, x6)  =  U31_GA(x2, x3, x4, x6)
U27_GA(x1, x2, x3)  =  U27_GA(x3)
SORT_SUITS_IN_GA(x1, x2)  =  SORT_SUITS_IN_GA(x1)
U35_GA(x1, x2, x3, x4, x5, x6)  =  U35_GA(x1, x3, x6)
I_SORT_IN_GGA(x1, x2, x3)  =  I_SORT_IN_GGA(x1, x2)
U37_GGA(x1, x2, x3, x4, x5)  =  U37_GGA(x2, x5)
INSERT_IN_GGA(x1, x2, x3)  =  INSERT_IN_GGA(x1, x2)
U39_GGA(x1, x2, x3, x4)  =  U39_GGA(x1, x2, x3, x4)
HIGHER_IN_GG(x1, x2)  =  HIGHER_IN_GG(x1, x2)
U42_GG(x1, x2)  =  U42_GG(x2)
U43_GG(x1, x2)  =  U43_GG(x1, x2)
U44_GG(x1, x2)  =  U44_GG(x2)
U45_GG(x1, x2)  =  U45_GG(x2)
INTEGER_IN_G(x1)  =  INTEGER_IN_G(x1)
U46_GG(x1, x2, x3)  =  U46_GG(x1, x2, x3)
U47_GG(x1, x2, x3)  =  U47_GG(x1, x2, x3)
U48_GG(x1, x2, x3)  =  U48_GG(x3)
>=_IN_GG(x1, x2)  =  >=_IN_GG(x1, x2)
U40_GGA(x1, x2, x3, x4, x5)  =  U40_GGA(x1, x2, x3, x5)
LOWER_IN_GG(x1, x2)  =  LOWER_IN_GG(x1, x2)
U49_GG(x1, x2)  =  U49_GG(x2)
HONOR_IN_GA(x1, x2)  =  HONOR_IN_GA(x1)
U19_GA(x1, x2, x3)  =  U19_GA(x3)
FACE_CARD_IN_GA(x1, x2)  =  FACE_CARD_IN_GA(x1)
U20_GA(x1, x2)  =  U20_GA(x2)
U50_GG(x1, x2)  =  U50_GG(x2)
>_IN_GG(x1, x2)  =  >_IN_GG(x1, x2)
U51_GG(x1, x2)  =  U51_GG(x2)
U52_GG(x1, x2)  =  U52_GG(x2)
U53_GG(x1, x2, x3)  =  U53_GG(x1, x2, x3)
U54_GG(x1, x2, x3)  =  U54_GG(x3)
U55_GG(x1, x2, x3)  =  U55_GG(x1, x2, x3)
U56_GG(x1, x2, x3)  =  U56_GG(x3)
<_IN_GG(x1, x2)  =  <_IN_GG(x1, x2)
U41_GGA(x1, x2, x3, x4, x5)  =  U41_GGA(x2, x5)
U38_GGA(x1, x2, x3, x4, x5)  =  U38_GGA(x5)
U36_GA(x1, x2, x3, x4, x5, x6)  =  U36_GA(x1, x4, x6)
U2_GAAA(x1, x2, x3, x4, x5, x6)  =  U2_GAAA(x5, x6)
EVALUATE_IN_GAA(x1, x2, x3)  =  EVALUATE_IN_GAA(x1)
U4_GAA(x1, x2, x3)  =  U4_GAA(x1, x3)
HCP_IN_GGA(x1, x2, x3)  =  HCP_IN_GGA(x1, x2)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x3, x6)
HCP_SUIT_IN_GA(x1, x2)  =  HCP_SUIT_IN_GA(x1)
U10_GA(x1, x2, x3)  =  U10_GA(x1, x3)
HONORS_IN_GGA(x1, x2, x3)  =  HONORS_IN_GGA(x1, x2)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(x2, x3, x5)
U15_GGA(x1, x2, x3, x4, x5, x6)  =  U15_GGA(x2, x3, x5, x6)
U16_GGA(x1, x2, x3, x4, x5)  =  U16_GGA(x2, x5)
IS_IN_AG(x1, x2)  =  IS_IN_AG(x2)
U17_GGA(x1, x2, x3, x4, x5)  =  U17_GGA(x5)
HONORS_IN_GAA(x1, x2, x3)  =  HONORS_IN_GAA(x1)
U14_GAA(x1, x2, x3, x4, x5)  =  U14_GAA(x2, x5)
U15_GAA(x1, x2, x3, x4, x5, x6)  =  U15_GAA(x2, x6)
U16_GAA(x1, x2, x3, x4, x5)  =  U16_GAA(x2, x5)
IS_IN_AA(x1, x2)  =  IS_IN_AA
U17_GAA(x1, x2, x3, x4, x5)  =  U17_GAA(x5)
U18_GAA(x1, x2, x3, x4)  =  U18_GAA(x4)
HONOR_IN_GG(x1, x2)  =  HONOR_IN_GG(x1, x2)
U19_GG(x1, x2, x3)  =  U19_GG(x3)
FACE_CARD_IN_GG(x1, x2)  =  FACE_CARD_IN_GG(x1, x2)
U20_GG(x1, x2)  =  U20_GG(x2)
U18_GGA(x1, x2, x3, x4)  =  U18_GGA(x4)
U11_GA(x1, x2, x3, x4)  =  U11_GA(x1, x4)
DIST_IN_GA(x1, x2)  =  DIST_IN_GA(x1)
U12_GA(x1, x2, x3, x4, x5)  =  U12_GA(x5)
MISC_IN_GA(x1, x2)  =  MISC_IN_GA(x1)
U21_GA(x1, x2, x3, x4, x5, x6)  =  U21_GA(x4, x6)
U22_GA(x1, x2, x3, x4, x5, x6)  =  U22_GA(x4, x6)
U23_GA(x1, x2, x3, x4, x5, x6)  =  U23_GA(x6)
LENGTH_IN_GA(x1, x2)  =  LENGTH_IN_GA(x1)
U24_GA(x1, x2, x3, x4, x5, x6, x7)  =  U24_GA(x7)
>_IN_AG(x1, x2)  =  >_IN_AG(x2)
U25_GA(x1, x2, x3, x4, x5, x6)  =  U25_GA(x6)
U13_GA(x1, x2, x3)  =  U13_GA(x3)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x3, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x6)
HCP_IN_GAA(x1, x2, x3)  =  HCP_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4, x5, x6)  =  U7_GAA(x3, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x3, x6)
U9_GAA(x1, x2, x3, x4, x5, x6)  =  U9_GAA(x6)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x4)
ADJUSTMENTS_IN_GA(x1, x2)  =  ADJUSTMENTS_IN_GA(x1)
U6_GAA(x1, x2, x3)  =  U6_GAA(x3)
U3_GAAA(x1, x2, x3, x4, x5)  =  U3_GAAA(x2, x5)
MAKE_BID_IN_GGAA(x1, x2, x3, x4)  =  MAKE_BID_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

BID_IN_GAAA(Hand, Attributes, Points, Bid) → U1_GAAA(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
BID_IN_GAAA(Hand, Attributes, Points, Bid) → SORT_HAND_IN_GA(Hand, SortedHand)
SORT_HAND_IN_GA(Hand, SortedHand) → U26_GA(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
SORT_HAND_IN_GA(Hand, SortedHand) → SPLIT_SUITS_IN_GA(Hand, SplitHand)
SPLIT_SUITS_IN_GA(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_GA(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
SPLIT_SUITS_IN_GA(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → FILTER_IN_GGA(Hand, spades, S)
FILTER_IN_GGA(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_GGA(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
FILTER_IN_GGA(.(-(Card, Suit), In), Suit, .(Card, Out)) → FILTER_IN_GGA(In, Suit, Out)
FILTER_IN_GGA(.(-(_A, X), In), Suit, Out) → U33_GGA(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
FILTER_IN_GGA(.(-(_A, X), In), Suit, Out) → \==_IN_GG(Suit, X)
U33_GGA(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_GGA(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U33_GGA(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → FILTER_IN_GGA(In, Suit, Out)
U28_GA(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_GA(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U28_GA(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → FILTER_IN_GGA(Hand, hearts, H)
U29_GA(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_GA(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U29_GA(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → FILTER_IN_GGA(Hand, diamonds, D)
U30_GA(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_GA(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U30_GA(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → FILTER_IN_GGA(Hand, clubs, C)
U26_GA(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_GA(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
U26_GA(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → SORT_SUITS_IN_GA(SplitHand, SortedHand)
SORT_SUITS_IN_GA(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_GA(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
SORT_SUITS_IN_GA(.(=(S, Ci), In), .(=(S, Co), Out)) → I_SORT_IN_GGA(Ci, [], Co)
I_SORT_IN_GGA(.(C1, Cn), Li, Lo) → U37_GGA(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
I_SORT_IN_GGA(.(C1, Cn), Li, Lo) → INSERT_IN_GGA(C1, Li, Lt)
INSERT_IN_GGA(X, .(Y, Z), .(X, .(Y, Z))) → U39_GGA(X, Y, Z, higher_in_gg(X, Y))
INSERT_IN_GGA(X, .(Y, Z), .(X, .(Y, Z))) → HIGHER_IN_GG(X, Y)
HIGHER_IN_GG(king, X) → U42_GG(X, \==_in_gg(X, ace))
HIGHER_IN_GG(king, X) → \==_IN_GG(X, ace)
HIGHER_IN_GG(queen, X) → U43_GG(X, \==_in_gg(X, ace))
HIGHER_IN_GG(queen, X) → \==_IN_GG(X, ace)
U43_GG(X, \==_out_gg(X, ace)) → U44_GG(X, \==_in_gg(X, king))
U43_GG(X, \==_out_gg(X, ace)) → \==_IN_GG(X, king)
HIGHER_IN_GG(jack, X) → U45_GG(X, integer_in_g(X))
HIGHER_IN_GG(jack, X) → INTEGER_IN_G(X)
HIGHER_IN_GG(X, Y) → U46_GG(X, Y, integer_in_g(X))
HIGHER_IN_GG(X, Y) → INTEGER_IN_G(X)
U46_GG(X, Y, integer_out_g(X)) → U47_GG(X, Y, integer_in_g(Y))
U46_GG(X, Y, integer_out_g(X)) → INTEGER_IN_G(Y)
U47_GG(X, Y, integer_out_g(Y)) → U48_GG(X, Y, >=_in_gg(X, Y))
U47_GG(X, Y, integer_out_g(Y)) → >=_IN_GG(X, Y)
INSERT_IN_GGA(X, .(Y, Z), .(Y, L)) → U40_GGA(X, Y, Z, L, lower_in_gg(X, Y))
INSERT_IN_GGA(X, .(Y, Z), .(Y, L)) → LOWER_IN_GG(X, Y)
LOWER_IN_GG(queen, X) → U49_GG(X, honor_in_ga(X, N))
LOWER_IN_GG(queen, X) → HONOR_IN_GA(X, N)
HONOR_IN_GA(C, N) → U19_GA(C, N, face_card_in_ga(C, N))
HONOR_IN_GA(C, N) → FACE_CARD_IN_GA(C, N)
HONOR_IN_GA(C, 0) → U20_GA(C, integer_in_g(C))
HONOR_IN_GA(C, 0) → INTEGER_IN_G(C)
U49_GG(X, honor_out_ga(X, N)) → U50_GG(X, >_in_gg(N, 2))
U49_GG(X, honor_out_ga(X, N)) → >_IN_GG(N, 2)
LOWER_IN_GG(jack, X) → U51_GG(X, honor_in_ga(X, N))
LOWER_IN_GG(jack, X) → HONOR_IN_GA(X, N)
U51_GG(X, honor_out_ga(X, N)) → U52_GG(X, >_in_gg(N, 1))
U51_GG(X, honor_out_ga(X, N)) → >_IN_GG(N, 1)
LOWER_IN_GG(X, Y) → U53_GG(X, Y, integer_in_g(X))
LOWER_IN_GG(X, Y) → INTEGER_IN_G(X)
U53_GG(X, Y, integer_out_g(X)) → U54_GG(X, Y, honor_in_ga(Y, _M))
U53_GG(X, Y, integer_out_g(X)) → HONOR_IN_GA(Y, _M)
U53_GG(X, Y, integer_out_g(X)) → U55_GG(X, Y, integer_in_g(Y))
U53_GG(X, Y, integer_out_g(X)) → INTEGER_IN_G(Y)
U55_GG(X, Y, integer_out_g(Y)) → U56_GG(X, Y, <_in_gg(X, Y))
U55_GG(X, Y, integer_out_g(Y)) → <_IN_GG(X, Y)
U40_GGA(X, Y, Z, L, lower_out_gg(X, Y)) → U41_GGA(X, Y, Z, L, insert_in_gga(X, Z, L))
U40_GGA(X, Y, Z, L, lower_out_gg(X, Y)) → INSERT_IN_GGA(X, Z, L)
U37_GGA(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_GGA(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U37_GGA(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → I_SORT_IN_GGA(Cn, Lt, Lo)
U35_GA(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_GA(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U35_GA(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → SORT_SUITS_IN_GA(In, Out)
U1_GAAA(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_GAAA(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
U1_GAAA(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → EVALUATE_IN_GAA(SortedHand, Attributes, Points)
EVALUATE_IN_GAA(Hand, [], P) → U4_GAA(Hand, P, hcp_in_gga(Hand, 0, HCP))
EVALUATE_IN_GAA(Hand, [], P) → HCP_IN_GGA(Hand, 0, HCP)
HCP_IN_GGA(.(=(_X, C), Sn), Ni, No) → U7_GGA(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
HCP_IN_GGA(.(=(_X, C), Sn), Ni, No) → HCP_SUIT_IN_GA(C, N)
HCP_SUIT_IN_GA(S, P) → U10_GA(S, P, honors_in_gga(S, 0, HP))
HCP_SUIT_IN_GA(S, P) → HONORS_IN_GGA(S, 0, HP)
HONORS_IN_GGA(.(C1, Cn), Pi, Po) → U14_GGA(C1, Cn, Pi, Po, honor_in_ga(C1, P))
HONORS_IN_GGA(.(C1, Cn), Pi, Po) → HONOR_IN_GA(C1, P)
U14_GGA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_GGA(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U14_GGA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → >_IN_GG(P, 0)
U15_GGA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_GGA(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
U15_GGA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → IS_IN_AG(Pt, +(P, Pi))
U16_GGA(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_GGA(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
U16_GGA(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → HONORS_IN_GAA(Cn, Pt, Po)
HONORS_IN_GAA(.(C1, Cn), Pi, Po) → U14_GAA(C1, Cn, Pi, Po, honor_in_ga(C1, P))
HONORS_IN_GAA(.(C1, Cn), Pi, Po) → HONOR_IN_GA(C1, P)
U14_GAA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_GAA(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U14_GAA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → >_IN_GG(P, 0)
U15_GAA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_GAA(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
U15_GAA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → IS_IN_AA(Pt, +(P, Pi))
U16_GAA(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_GAA(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
U16_GAA(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → HONORS_IN_GAA(Cn, Pt, Po)
HONORS_IN_GAA(.(C1, Cn), Pi, Pi) → U18_GAA(C1, Cn, Pi, honor_in_gg(C1, 0))
HONORS_IN_GAA(.(C1, Cn), Pi, Pi) → HONOR_IN_GG(C1, 0)
HONOR_IN_GG(C, N) → U19_GG(C, N, face_card_in_gg(C, N))
HONOR_IN_GG(C, N) → FACE_CARD_IN_GG(C, N)
HONOR_IN_GG(C, 0) → U20_GG(C, integer_in_g(C))
HONOR_IN_GG(C, 0) → INTEGER_IN_G(C)
HONORS_IN_GGA(.(C1, Cn), Pi, Pi) → U18_GGA(C1, Cn, Pi, honor_in_gg(C1, 0))
HONORS_IN_GGA(.(C1, Cn), Pi, Pi) → HONOR_IN_GG(C1, 0)
U10_GA(S, P, honors_out_gga(S, 0, HP)) → U11_GA(S, P, HP, dist_in_ga(S, DP))
U10_GA(S, P, honors_out_gga(S, 0, HP)) → DIST_IN_GA(S, DP)
U11_GA(S, P, HP, dist_out_ga(S, DP)) → U12_GA(S, P, HP, DP, misc_in_ga(S, MP))
U11_GA(S, P, HP, dist_out_ga(S, DP)) → MISC_IN_GA(S, MP)
MISC_IN_GA(.(_X, .(_Y, .(H3, Rem))), P) → U21_GA(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
MISC_IN_GA(.(_X, .(_Y, .(H3, Rem))), P) → HONOR_IN_GA(H3, X)
U21_GA(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_GA(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U21_GA(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → >_IN_GG(X, 0)
U22_GA(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_GA(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
U22_GA(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → LENGTH_IN_GA(Rem, N)
U23_GA(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_GA(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
U23_GA(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → >_IN_AG(N, 2)
U24_GA(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_GA(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U24_GA(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → IS_IN_AA(P, -(N, 2))
U12_GA(S, P, HP, DP, misc_out_ga(S, MP)) → U13_GA(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U12_GA(S, P, HP, DP, misc_out_ga(S, MP)) → IS_IN_AA(P, +(HP, +(DP, MP)))
U7_GGA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_GGA(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U7_GGA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → IS_IN_AA(Nt, +(N, Ni))
U8_GGA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_GGA(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U8_GGA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → HCP_IN_GAA(Sn, Nt, No)
HCP_IN_GAA(.(=(_X, C), Sn), Ni, No) → U7_GAA(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
HCP_IN_GAA(.(=(_X, C), Sn), Ni, No) → HCP_SUIT_IN_GA(C, N)
U7_GAA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_GAA(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U7_GAA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → IS_IN_AA(Nt, +(N, Ni))
U8_GAA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_GAA(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U8_GAA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → HCP_IN_GAA(Sn, Nt, No)
U4_GAA(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_GAA(Hand, P, HCP, adjustments_in_ga(Hand, MP))
U4_GAA(Hand, P, hcp_out_gga(Hand, 0, HCP)) → ADJUSTMENTS_IN_GA(Hand, MP)
U5_GAA(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_GAA(Hand, P, is_in_aa(P, +(HCP, MP)))
U5_GAA(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → IS_IN_AA(P, +(HCP, MP))
U2_GAAA(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_GAAA(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
U2_GAAA(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → MAKE_BID_IN_GGAA(SortedHand, Attributes, Points, Bid)

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
BID_IN_GAAA(x1, x2, x3, x4)  =  BID_IN_GAAA(x1)
U1_GAAA(x1, x2, x3, x4, x5)  =  U1_GAAA(x5)
SORT_HAND_IN_GA(x1, x2)  =  SORT_HAND_IN_GA(x1)
U26_GA(x1, x2, x3)  =  U26_GA(x3)
SPLIT_SUITS_IN_GA(x1, x2)  =  SPLIT_SUITS_IN_GA(x1)
U28_GA(x1, x2, x3, x4, x5, x6)  =  U28_GA(x1, x6)
FILTER_IN_GGA(x1, x2, x3)  =  FILTER_IN_GGA(x1, x2)
U32_GGA(x1, x2, x3, x4, x5)  =  U32_GGA(x1, x5)
U33_GGA(x1, x2, x3, x4, x5, x6)  =  U33_GGA(x3, x4, x6)
\==_IN_GG(x1, x2)  =  \==_IN_GG(x1, x2)
U34_GGA(x1, x2, x3, x4, x5, x6)  =  U34_GGA(x6)
U29_GA(x1, x2, x3, x4, x5, x6)  =  U29_GA(x1, x2, x6)
U30_GA(x1, x2, x3, x4, x5, x6)  =  U30_GA(x1, x2, x3, x6)
U31_GA(x1, x2, x3, x4, x5, x6)  =  U31_GA(x2, x3, x4, x6)
U27_GA(x1, x2, x3)  =  U27_GA(x3)
SORT_SUITS_IN_GA(x1, x2)  =  SORT_SUITS_IN_GA(x1)
U35_GA(x1, x2, x3, x4, x5, x6)  =  U35_GA(x1, x3, x6)
I_SORT_IN_GGA(x1, x2, x3)  =  I_SORT_IN_GGA(x1, x2)
U37_GGA(x1, x2, x3, x4, x5)  =  U37_GGA(x2, x5)
INSERT_IN_GGA(x1, x2, x3)  =  INSERT_IN_GGA(x1, x2)
U39_GGA(x1, x2, x3, x4)  =  U39_GGA(x1, x2, x3, x4)
HIGHER_IN_GG(x1, x2)  =  HIGHER_IN_GG(x1, x2)
U42_GG(x1, x2)  =  U42_GG(x2)
U43_GG(x1, x2)  =  U43_GG(x1, x2)
U44_GG(x1, x2)  =  U44_GG(x2)
U45_GG(x1, x2)  =  U45_GG(x2)
INTEGER_IN_G(x1)  =  INTEGER_IN_G(x1)
U46_GG(x1, x2, x3)  =  U46_GG(x1, x2, x3)
U47_GG(x1, x2, x3)  =  U47_GG(x1, x2, x3)
U48_GG(x1, x2, x3)  =  U48_GG(x3)
>=_IN_GG(x1, x2)  =  >=_IN_GG(x1, x2)
U40_GGA(x1, x2, x3, x4, x5)  =  U40_GGA(x1, x2, x3, x5)
LOWER_IN_GG(x1, x2)  =  LOWER_IN_GG(x1, x2)
U49_GG(x1, x2)  =  U49_GG(x2)
HONOR_IN_GA(x1, x2)  =  HONOR_IN_GA(x1)
U19_GA(x1, x2, x3)  =  U19_GA(x3)
FACE_CARD_IN_GA(x1, x2)  =  FACE_CARD_IN_GA(x1)
U20_GA(x1, x2)  =  U20_GA(x2)
U50_GG(x1, x2)  =  U50_GG(x2)
>_IN_GG(x1, x2)  =  >_IN_GG(x1, x2)
U51_GG(x1, x2)  =  U51_GG(x2)
U52_GG(x1, x2)  =  U52_GG(x2)
U53_GG(x1, x2, x3)  =  U53_GG(x1, x2, x3)
U54_GG(x1, x2, x3)  =  U54_GG(x3)
U55_GG(x1, x2, x3)  =  U55_GG(x1, x2, x3)
U56_GG(x1, x2, x3)  =  U56_GG(x3)
<_IN_GG(x1, x2)  =  <_IN_GG(x1, x2)
U41_GGA(x1, x2, x3, x4, x5)  =  U41_GGA(x2, x5)
U38_GGA(x1, x2, x3, x4, x5)  =  U38_GGA(x5)
U36_GA(x1, x2, x3, x4, x5, x6)  =  U36_GA(x1, x4, x6)
U2_GAAA(x1, x2, x3, x4, x5, x6)  =  U2_GAAA(x5, x6)
EVALUATE_IN_GAA(x1, x2, x3)  =  EVALUATE_IN_GAA(x1)
U4_GAA(x1, x2, x3)  =  U4_GAA(x1, x3)
HCP_IN_GGA(x1, x2, x3)  =  HCP_IN_GGA(x1, x2)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x3, x6)
HCP_SUIT_IN_GA(x1, x2)  =  HCP_SUIT_IN_GA(x1)
U10_GA(x1, x2, x3)  =  U10_GA(x1, x3)
HONORS_IN_GGA(x1, x2, x3)  =  HONORS_IN_GGA(x1, x2)
U14_GGA(x1, x2, x3, x4, x5)  =  U14_GGA(x2, x3, x5)
U15_GGA(x1, x2, x3, x4, x5, x6)  =  U15_GGA(x2, x3, x5, x6)
U16_GGA(x1, x2, x3, x4, x5)  =  U16_GGA(x2, x5)
IS_IN_AG(x1, x2)  =  IS_IN_AG(x2)
U17_GGA(x1, x2, x3, x4, x5)  =  U17_GGA(x5)
HONORS_IN_GAA(x1, x2, x3)  =  HONORS_IN_GAA(x1)
U14_GAA(x1, x2, x3, x4, x5)  =  U14_GAA(x2, x5)
U15_GAA(x1, x2, x3, x4, x5, x6)  =  U15_GAA(x2, x6)
U16_GAA(x1, x2, x3, x4, x5)  =  U16_GAA(x2, x5)
IS_IN_AA(x1, x2)  =  IS_IN_AA
U17_GAA(x1, x2, x3, x4, x5)  =  U17_GAA(x5)
U18_GAA(x1, x2, x3, x4)  =  U18_GAA(x4)
HONOR_IN_GG(x1, x2)  =  HONOR_IN_GG(x1, x2)
U19_GG(x1, x2, x3)  =  U19_GG(x3)
FACE_CARD_IN_GG(x1, x2)  =  FACE_CARD_IN_GG(x1, x2)
U20_GG(x1, x2)  =  U20_GG(x2)
U18_GGA(x1, x2, x3, x4)  =  U18_GGA(x4)
U11_GA(x1, x2, x3, x4)  =  U11_GA(x1, x4)
DIST_IN_GA(x1, x2)  =  DIST_IN_GA(x1)
U12_GA(x1, x2, x3, x4, x5)  =  U12_GA(x5)
MISC_IN_GA(x1, x2)  =  MISC_IN_GA(x1)
U21_GA(x1, x2, x3, x4, x5, x6)  =  U21_GA(x4, x6)
U22_GA(x1, x2, x3, x4, x5, x6)  =  U22_GA(x4, x6)
U23_GA(x1, x2, x3, x4, x5, x6)  =  U23_GA(x6)
LENGTH_IN_GA(x1, x2)  =  LENGTH_IN_GA(x1)
U24_GA(x1, x2, x3, x4, x5, x6, x7)  =  U24_GA(x7)
>_IN_AG(x1, x2)  =  >_IN_AG(x2)
U25_GA(x1, x2, x3, x4, x5, x6)  =  U25_GA(x6)
U13_GA(x1, x2, x3)  =  U13_GA(x3)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x3, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x6)
HCP_IN_GAA(x1, x2, x3)  =  HCP_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4, x5, x6)  =  U7_GAA(x3, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x3, x6)
U9_GAA(x1, x2, x3, x4, x5, x6)  =  U9_GAA(x6)
U5_GAA(x1, x2, x3, x4)  =  U5_GAA(x4)
ADJUSTMENTS_IN_GA(x1, x2)  =  ADJUSTMENTS_IN_GA(x1)
U6_GAA(x1, x2, x3)  =  U6_GAA(x3)
U3_GAAA(x1, x2, x3, x4, x5)  =  U3_GAAA(x2, x5)
MAKE_BID_IN_GGAA(x1, x2, x3, x4)  =  MAKE_BID_IN_GGAA(x1, x2)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 6 SCCs with 116 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HONORS_IN_GAA(.(C1, Cn), Pi, Po) → U14_GAA(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_GAA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_GAA(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_GAA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_GAA(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
U16_GAA(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → HONORS_IN_GAA(Cn, Pt, Po)

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
HONORS_IN_GAA(x1, x2, x3)  =  HONORS_IN_GAA(x1)
U14_GAA(x1, x2, x3, x4, x5)  =  U14_GAA(x2, x5)
U15_GAA(x1, x2, x3, x4, x5, x6)  =  U15_GAA(x2, x6)
U16_GAA(x1, x2, x3, x4, x5)  =  U16_GAA(x2, x5)

We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HONORS_IN_GAA(.(C1, Cn), Pi, Po) → U14_GAA(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_GAA(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_GAA(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_GAA(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_GAA(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
U16_GAA(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → HONORS_IN_GAA(Cn, Pt, Po)

The TRS R consists of the following rules:

honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
integer_in_g(X0) → integer_out_g(X0)

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
ace  =  ace
king  =  king
queen  =  queen
jack  =  jack
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
1  =  1
0  =  0
+(x1, x2)  =  +(x1, x2)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
4  =  4
3  =  3
HONORS_IN_GAA(x1, x2, x3)  =  HONORS_IN_GAA(x1)
U14_GAA(x1, x2, x3, x4, x5)  =  U14_GAA(x2, x5)
U15_GAA(x1, x2, x3, x4, x5, x6)  =  U15_GAA(x2, x6)
U16_GAA(x1, x2, x3, x4, x5)  =  U16_GAA(x2, x5)

We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HONORS_IN_GAA(.(C1, Cn)) → U14_GAA(Cn, honor_in_ga(C1))
U14_GAA(Cn, honor_out_ga(P)) → U15_GAA(Cn, >_in_gg(P, 0))
U15_GAA(Cn, >_out_gg) → U16_GAA(Cn, is_in_aa)
U16_GAA(Cn, is_out_aa) → HONORS_IN_GAA(Cn)

The TRS R consists of the following rules:

honor_in_ga(C) → U19_ga(face_card_in_ga(C))
honor_in_ga(C) → U20_ga(integer_in_g(C))
>_in_gg(X0, X1) → >_out_gg
is_in_aais_out_aa
U19_ga(face_card_out_ga(N)) → honor_out_ga(N)
U20_ga(integer_out_g) → honor_out_ga(0)
face_card_in_ga(ace) → face_card_out_ga(4)
face_card_in_ga(king) → face_card_out_ga(3)
face_card_in_ga(queen) → face_card_out_ga(2)
face_card_in_ga(jack) → face_card_out_ga(1)
integer_in_g(X0) → integer_out_g

The set Q consists of the following terms:

honor_in_ga(x0)
>_in_gg(x0, x1)
is_in_aa
U19_ga(x0)
U20_ga(x0)
face_card_in_ga(x0)
integer_in_g(x0)

We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • U14_GAA(Cn, honor_out_ga(P)) → U15_GAA(Cn, >_in_gg(P, 0))
    The graph contains the following edges 1 >= 1

  • U16_GAA(Cn, is_out_aa) → HONORS_IN_GAA(Cn)
    The graph contains the following edges 1 >= 1

  • U15_GAA(Cn, >_out_gg) → U16_GAA(Cn, is_in_aa)
    The graph contains the following edges 1 >= 1

  • HONORS_IN_GAA(.(C1, Cn)) → U14_GAA(Cn, honor_in_ga(C1))
    The graph contains the following edges 1 > 1

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HCP_IN_GAA(.(=(_X, C), Sn), Ni, No) → U7_GAA(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_GAA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_GAA(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_GAA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → HCP_IN_GAA(Sn, Nt, No)

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
HCP_IN_GAA(x1, x2, x3)  =  HCP_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4, x5, x6)  =  U7_GAA(x3, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x3, x6)

We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HCP_IN_GAA(.(=(_X, C), Sn), Ni, No) → U7_GAA(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_GAA(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_GAA(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_GAA(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → HCP_IN_GAA(Sn, Nt, No)

The TRS R consists of the following rules:

hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
integer_in_g(X0) → integer_out_g(X0)
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)

The argument filtering Pi contains the following mapping:
[]  =  []
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
=(x1, x2)  =  =(x1, x2)
ace  =  ace
king  =  king
queen  =  queen
jack  =  jack
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
1  =  1
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
HCP_IN_GAA(x1, x2, x3)  =  HCP_IN_GAA(x1)
U7_GAA(x1, x2, x3, x4, x5, x6)  =  U7_GAA(x3, x6)
U8_GAA(x1, x2, x3, x4, x5, x6)  =  U8_GAA(x3, x6)

We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HCP_IN_GAA(.(=(_X, C), Sn)) → U7_GAA(Sn, hcp_suit_in_ga(C))
U7_GAA(Sn, hcp_suit_out_ga) → U8_GAA(Sn, is_in_aa)
U8_GAA(Sn, is_out_aa) → HCP_IN_GAA(Sn)

The TRS R consists of the following rules:

hcp_suit_in_ga(S) → U10_ga(S, honors_in_gga(S, 0))
is_in_aais_out_aa
U10_ga(S, honors_out_gga) → U11_ga(S, dist_in_ga(S))
honors_in_gga([], Pi) → honors_out_gga
honors_in_gga(.(C1, Cn), Pi) → U14_gga(Cn, Pi, honor_in_ga(C1))
honors_in_gga(.(C1, Cn), Pi) → U18_gga(honor_in_gg(C1, 0))
U11_ga(S, dist_out_ga(DP)) → U12_ga(misc_in_ga(S))
U14_gga(Cn, Pi, honor_out_ga(P)) → U15_gga(Cn, Pi, P, >_in_gg(P, 0))
U18_gga(honor_out_gg) → honors_out_gga
dist_in_ga([]) → dist_out_ga(3)
dist_in_ga(.(X2, [])) → dist_out_ga(2)
dist_in_ga(.(X3, .(X4, []))) → dist_out_ga(1)
dist_in_ga(.(X5, .(X6, .(X7, X8)))) → dist_out_ga(0)
U12_ga(misc_out_ga) → U13_ga(is_in_aa)
honor_in_ga(C) → U19_ga(face_card_in_ga(C))
honor_in_ga(C) → U20_ga(integer_in_g(C))
U15_gga(Cn, Pi, P, >_out_gg) → U16_gga(Cn, is_in_ag(+(P, Pi)))
honor_in_gg(C, N) → U19_gg(face_card_in_gg(C, N))
honor_in_gg(C, 0) → U20_gg(integer_in_g(C))
misc_in_ga(.(ace, [])) → misc_out_ga
misc_in_ga(.(king, [])) → misc_out_ga
misc_in_ga(.(queen, .(X9, []))) → misc_out_ga
misc_in_ga(.(jack, .(X10, []))) → misc_out_ga
misc_in_ga(.(_X, .(_Y, .(H3, Rem)))) → U21_ga(Rem, honor_in_ga(H3))
misc_in_ga(X11) → misc_out_ga
U13_ga(is_out_aa) → hcp_suit_out_ga
U19_ga(face_card_out_ga(N)) → honor_out_ga(N)
U20_ga(integer_out_g) → honor_out_ga(0)
>_in_gg(X0, X1) → >_out_gg
U16_gga(Cn, is_out_ag) → U17_gga(honors_in_gaa(Cn))
U19_gg(face_card_out_gg) → honor_out_gg
U20_gg(integer_out_g) → honor_out_gg
U21_ga(Rem, honor_out_ga(X)) → U22_ga(Rem, >_in_gg(X, 0))
face_card_in_ga(ace) → face_card_out_ga(4)
face_card_in_ga(king) → face_card_out_ga(3)
face_card_in_ga(queen) → face_card_out_ga(2)
face_card_in_ga(jack) → face_card_out_ga(1)
integer_in_g(X0) → integer_out_g
is_in_ag(X1) → is_out_ag
U17_gga(honors_out_gaa) → honors_out_gga
face_card_in_gg(ace, 4) → face_card_out_gg
face_card_in_gg(king, 3) → face_card_out_gg
face_card_in_gg(queen, 2) → face_card_out_gg
face_card_in_gg(jack, 1) → face_card_out_gg
U22_ga(Rem, >_out_gg) → U23_ga(length_in_ga(Rem))
honors_in_gaa([]) → honors_out_gaa
honors_in_gaa(.(C1, Cn)) → U14_gaa(Cn, honor_in_ga(C1))
honors_in_gaa(.(C1, Cn)) → U18_gaa(honor_in_gg(C1, 0))
U23_ga(length_out_ga) → U24_ga(>_in_ag(2))
U14_gaa(Cn, honor_out_ga(P)) → U15_gaa(Cn, >_in_gg(P, 0))
U18_gaa(honor_out_gg) → honors_out_gaa
length_in_ga(X0) → length_out_ga
U24_ga(>_out_ag) → U25_ga(is_in_aa)
U15_gaa(Cn, >_out_gg) → U16_gaa(Cn, is_in_aa)
>_in_ag(X1) → >_out_ag
U25_ga(is_out_aa) → misc_out_ga
U16_gaa(Cn, is_out_aa) → U17_gaa(honors_in_gaa(Cn))
U17_gaa(honors_out_gaa) → honors_out_gaa

The set Q consists of the following terms:

hcp_suit_in_ga(x0)
is_in_aa
U10_ga(x0, x1)
honors_in_gga(x0, x1)
U11_ga(x0, x1)
U14_gga(x0, x1, x2)
U18_gga(x0)
dist_in_ga(x0)
U12_ga(x0)
honor_in_ga(x0)
U15_gga(x0, x1, x2, x3)
honor_in_gg(x0, x1)
misc_in_ga(x0)
U13_ga(x0)
U19_ga(x0)
U20_ga(x0)
>_in_gg(x0, x1)
U16_gga(x0, x1)
U19_gg(x0)
U20_gg(x0)
U21_ga(x0, x1)
face_card_in_ga(x0)
integer_in_g(x0)
is_in_ag(x0)
U17_gga(x0)
face_card_in_gg(x0, x1)
U22_ga(x0, x1)
honors_in_gaa(x0)
U23_ga(x0)
U14_gaa(x0, x1)
U18_gaa(x0)
length_in_ga(x0)
U24_ga(x0)
U15_gaa(x0, x1)
>_in_ag(x0)
U25_ga(x0)
U16_gaa(x0, x1)
U17_gaa(x0)

We have to consider all (P,Q,R)-chains.

(21) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • U7_GAA(Sn, hcp_suit_out_ga) → U8_GAA(Sn, is_in_aa)
    The graph contains the following edges 1 >= 1

  • U8_GAA(Sn, is_out_aa) → HCP_IN_GAA(Sn)
    The graph contains the following edges 1 >= 1

  • HCP_IN_GAA(.(=(_X, C), Sn)) → U7_GAA(Sn, hcp_suit_in_ga(C))
    The graph contains the following edges 1 > 1

(22) YES

(23) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

INSERT_IN_GGA(X, .(Y, Z), .(Y, L)) → U40_GGA(X, Y, Z, L, lower_in_gg(X, Y))
U40_GGA(X, Y, Z, L, lower_out_gg(X, Y)) → INSERT_IN_GGA(X, Z, L)

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
INSERT_IN_GGA(x1, x2, x3)  =  INSERT_IN_GGA(x1, x2)
U40_GGA(x1, x2, x3, x4, x5)  =  U40_GGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(24) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(25) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

INSERT_IN_GGA(X, .(Y, Z), .(Y, L)) → U40_GGA(X, Y, Z, L, lower_in_gg(X, Y))
U40_GGA(X, Y, Z, L, lower_out_gg(X, Y)) → INSERT_IN_GGA(X, Z, L)

The TRS R consists of the following rules:

lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
integer_in_g(X0) → integer_out_g(X0)
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
<_in_gg(X0, X1) → <_out_gg(X0, X1)

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
ace  =  ace
king  =  king
queen  =  queen
jack  =  jack
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
0  =  0
4  =  4
3  =  3
INSERT_IN_GGA(x1, x2, x3)  =  INSERT_IN_GGA(x1, x2)
U40_GGA(x1, x2, x3, x4, x5)  =  U40_GGA(x1, x2, x3, x5)

We have to consider all (P,R,Pi)-chains

(26) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(27) Obligation:

Q DP problem:
The TRS P consists of the following rules:

INSERT_IN_GGA(X, .(Y, Z)) → U40_GGA(X, Y, Z, lower_in_gg(X, Y))
U40_GGA(X, Y, Z, lower_out_gg) → INSERT_IN_GGA(X, Z)

The TRS R consists of the following rules:

lower_in_gg(king, ace) → lower_out_gg
lower_in_gg(queen, X) → U49_gg(honor_in_ga(X))
lower_in_gg(jack, X) → U51_gg(honor_in_ga(X))
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U49_gg(honor_out_ga(N)) → U50_gg(>_in_gg(N, 2))
U51_gg(honor_out_ga(N)) → U52_gg(>_in_gg(N, 1))
U53_gg(X, Y, integer_out_g) → U54_gg(honor_in_ga(Y))
U53_gg(X, Y, integer_out_g) → U55_gg(X, Y, integer_in_g(Y))
honor_in_ga(C) → U19_ga(face_card_in_ga(C))
honor_in_ga(C) → U20_ga(integer_in_g(C))
U50_gg(>_out_gg) → lower_out_gg
U52_gg(>_out_gg) → lower_out_gg
integer_in_g(X0) → integer_out_g
U54_gg(honor_out_ga(_M)) → lower_out_gg
U55_gg(X, Y, integer_out_g) → U56_gg(<_in_gg(X, Y))
U19_ga(face_card_out_ga(N)) → honor_out_ga(N)
U20_ga(integer_out_g) → honor_out_ga(0)
>_in_gg(X0, X1) → >_out_gg
U56_gg(<_out_gg) → lower_out_gg
face_card_in_ga(ace) → face_card_out_ga(4)
face_card_in_ga(king) → face_card_out_ga(3)
face_card_in_ga(queen) → face_card_out_ga(2)
face_card_in_ga(jack) → face_card_out_ga(1)
<_in_gg(X0, X1) → <_out_gg

The set Q consists of the following terms:

lower_in_gg(x0, x1)
U49_gg(x0)
U51_gg(x0)
U53_gg(x0, x1, x2)
honor_in_ga(x0)
U50_gg(x0)
U52_gg(x0)
integer_in_g(x0)
U54_gg(x0)
U55_gg(x0, x1, x2)
U19_ga(x0)
U20_ga(x0)
>_in_gg(x0, x1)
U56_gg(x0)
face_card_in_ga(x0)
<_in_gg(x0, x1)

We have to consider all (P,Q,R)-chains.

(28) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • U40_GGA(X, Y, Z, lower_out_gg) → INSERT_IN_GGA(X, Z)
    The graph contains the following edges 1 >= 1, 3 >= 2

  • INSERT_IN_GGA(X, .(Y, Z)) → U40_GGA(X, Y, Z, lower_in_gg(X, Y))
    The graph contains the following edges 1 >= 1, 2 > 2, 2 > 3

(29) YES

(30) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U37_GGA(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → I_SORT_IN_GGA(Cn, Lt, Lo)
I_SORT_IN_GGA(.(C1, Cn), Li, Lo) → U37_GGA(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
I_SORT_IN_GGA(x1, x2, x3)  =  I_SORT_IN_GGA(x1, x2)
U37_GGA(x1, x2, x3, x4, x5)  =  U37_GGA(x2, x5)

We have to consider all (P,R,Pi)-chains

(31) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(32) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U37_GGA(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → I_SORT_IN_GGA(Cn, Lt, Lo)
I_SORT_IN_GGA(.(C1, Cn), Li, Lo) → U37_GGA(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))

The TRS R consists of the following rules:

insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
integer_in_g(X0) → integer_out_g(X0)
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
<_in_gg(X0, X1) → <_out_gg(X0, X1)

The argument filtering Pi contains the following mapping:
[]  =  []
.(x1, x2)  =  .(x1, x2)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
0  =  0
4  =  4
3  =  3
I_SORT_IN_GGA(x1, x2, x3)  =  I_SORT_IN_GGA(x1, x2)
U37_GGA(x1, x2, x3, x4, x5)  =  U37_GGA(x2, x5)

We have to consider all (P,R,Pi)-chains

(33) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(34) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U37_GGA(Cn, insert_out_gga(Lt)) → I_SORT_IN_GGA(Cn, Lt)
I_SORT_IN_GGA(.(C1, Cn), Li) → U37_GGA(Cn, insert_in_gga(C1, Li))

The TRS R consists of the following rules:

insert_in_gga(X, []) → insert_out_gga(.(X, []))
insert_in_gga(X, .(Y, Z)) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
insert_in_gga(X, .(Y, Z)) → U40_gga(X, Y, Z, lower_in_gg(X, Y))
U39_gga(X, Y, Z, higher_out_gg) → insert_out_gga(.(X, .(Y, Z)))
U40_gga(X, Y, Z, lower_out_gg) → U41_gga(Y, insert_in_gga(X, Z))
higher_in_gg(ace, X13) → higher_out_gg
higher_in_gg(king, X) → U42_gg(\==_in_gg(X, ace))
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
higher_in_gg(jack, X) → U45_gg(integer_in_g(X))
higher_in_gg(jack, jack) → higher_out_gg
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
lower_in_gg(king, ace) → lower_out_gg
lower_in_gg(queen, X) → U49_gg(honor_in_ga(X))
lower_in_gg(jack, X) → U51_gg(honor_in_ga(X))
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U41_gga(Y, insert_out_gga(L)) → insert_out_gga(.(Y, L))
U42_gg(\==_out_gg) → higher_out_gg
U43_gg(X, \==_out_gg) → U44_gg(\==_in_gg(X, king))
U45_gg(integer_out_g) → higher_out_gg
U46_gg(X, Y, integer_out_g) → U47_gg(X, Y, integer_in_g(Y))
U49_gg(honor_out_ga(N)) → U50_gg(>_in_gg(N, 2))
U51_gg(honor_out_ga(N)) → U52_gg(>_in_gg(N, 1))
U53_gg(X, Y, integer_out_g) → U54_gg(honor_in_ga(Y))
U53_gg(X, Y, integer_out_g) → U55_gg(X, Y, integer_in_g(Y))
\==_in_gg(X0, X1) → \==_out_gg
U44_gg(\==_out_gg) → higher_out_gg
integer_in_g(X0) → integer_out_g
U47_gg(X, Y, integer_out_g) → U48_gg(>=_in_gg(X, Y))
honor_in_ga(C) → U19_ga(face_card_in_ga(C))
honor_in_ga(C) → U20_ga(integer_in_g(C))
U50_gg(>_out_gg) → lower_out_gg
U52_gg(>_out_gg) → lower_out_gg
U54_gg(honor_out_ga(_M)) → lower_out_gg
U55_gg(X, Y, integer_out_g) → U56_gg(<_in_gg(X, Y))
U48_gg(>=_out_gg) → higher_out_gg
U19_ga(face_card_out_ga(N)) → honor_out_ga(N)
U20_ga(integer_out_g) → honor_out_ga(0)
>_in_gg(X0, X1) → >_out_gg
U56_gg(<_out_gg) → lower_out_gg
>=_in_gg(X0, X1) → >=_out_gg
face_card_in_ga(ace) → face_card_out_ga(4)
face_card_in_ga(king) → face_card_out_ga(3)
face_card_in_ga(queen) → face_card_out_ga(2)
face_card_in_ga(jack) → face_card_out_ga(1)
<_in_gg(X0, X1) → <_out_gg

The set Q consists of the following terms:

insert_in_gga(x0, x1)
U39_gga(x0, x1, x2, x3)
U40_gga(x0, x1, x2, x3)
higher_in_gg(x0, x1)
lower_in_gg(x0, x1)
U41_gga(x0, x1)
U42_gg(x0)
U43_gg(x0, x1)
U45_gg(x0)
U46_gg(x0, x1, x2)
U49_gg(x0)
U51_gg(x0)
U53_gg(x0, x1, x2)
\==_in_gg(x0, x1)
U44_gg(x0)
integer_in_g(x0)
U47_gg(x0, x1, x2)
honor_in_ga(x0)
U50_gg(x0)
U52_gg(x0)
U54_gg(x0)
U55_gg(x0, x1, x2)
U48_gg(x0)
U19_ga(x0)
U20_ga(x0)
>_in_gg(x0, x1)
U56_gg(x0)
>=_in_gg(x0, x1)
face_card_in_ga(x0)
<_in_gg(x0, x1)

We have to consider all (P,Q,R)-chains.

(35) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • I_SORT_IN_GGA(.(C1, Cn), Li) → U37_GGA(Cn, insert_in_gga(C1, Li))
    The graph contains the following edges 1 > 1

  • U37_GGA(Cn, insert_out_gga(Lt)) → I_SORT_IN_GGA(Cn, Lt)
    The graph contains the following edges 1 >= 1, 2 > 2

(36) YES

(37) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U35_GA(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → SORT_SUITS_IN_GA(In, Out)
SORT_SUITS_IN_GA(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_GA(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
SORT_SUITS_IN_GA(x1, x2)  =  SORT_SUITS_IN_GA(x1)
U35_GA(x1, x2, x3, x4, x5, x6)  =  U35_GA(x1, x3, x6)

We have to consider all (P,R,Pi)-chains

(38) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(39) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U35_GA(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → SORT_SUITS_IN_GA(In, Out)
SORT_SUITS_IN_GA(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_GA(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))

The TRS R consists of the following rules:

i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
integer_in_g(X0) → integer_out_g(X0)
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
<_in_gg(X0, X1) → <_out_gg(X0, X1)

The argument filtering Pi contains the following mapping:
[]  =  []
.(x1, x2)  =  .(x1, x2)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
=(x1, x2)  =  =(x1, x2)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
0  =  0
4  =  4
3  =  3
SORT_SUITS_IN_GA(x1, x2)  =  SORT_SUITS_IN_GA(x1)
U35_GA(x1, x2, x3, x4, x5, x6)  =  U35_GA(x1, x3, x6)

We have to consider all (P,R,Pi)-chains

(40) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(41) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U35_GA(S, In, i_sort_out_gga(Co)) → SORT_SUITS_IN_GA(In)
SORT_SUITS_IN_GA(.(=(S, Ci), In)) → U35_GA(S, In, i_sort_in_gga(Ci, []))

The TRS R consists of the following rules:

i_sort_in_gga([], L) → i_sort_out_gga(L)
i_sort_in_gga(.(C1, Cn), Li) → U37_gga(Cn, insert_in_gga(C1, Li))
U37_gga(Cn, insert_out_gga(Lt)) → U38_gga(i_sort_in_gga(Cn, Lt))
insert_in_gga(X, []) → insert_out_gga(.(X, []))
insert_in_gga(X, .(Y, Z)) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
insert_in_gga(X, .(Y, Z)) → U40_gga(X, Y, Z, lower_in_gg(X, Y))
U38_gga(i_sort_out_gga(Lo)) → i_sort_out_gga(Lo)
U39_gga(X, Y, Z, higher_out_gg) → insert_out_gga(.(X, .(Y, Z)))
U40_gga(X, Y, Z, lower_out_gg) → U41_gga(Y, insert_in_gga(X, Z))
higher_in_gg(ace, X13) → higher_out_gg
higher_in_gg(king, X) → U42_gg(\==_in_gg(X, ace))
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
higher_in_gg(jack, X) → U45_gg(integer_in_g(X))
higher_in_gg(jack, jack) → higher_out_gg
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
lower_in_gg(king, ace) → lower_out_gg
lower_in_gg(queen, X) → U49_gg(honor_in_ga(X))
lower_in_gg(jack, X) → U51_gg(honor_in_ga(X))
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U41_gga(Y, insert_out_gga(L)) → insert_out_gga(.(Y, L))
U42_gg(\==_out_gg) → higher_out_gg
U43_gg(X, \==_out_gg) → U44_gg(\==_in_gg(X, king))
U45_gg(integer_out_g) → higher_out_gg
U46_gg(X, Y, integer_out_g) → U47_gg(X, Y, integer_in_g(Y))
U49_gg(honor_out_ga(N)) → U50_gg(>_in_gg(N, 2))
U51_gg(honor_out_ga(N)) → U52_gg(>_in_gg(N, 1))
U53_gg(X, Y, integer_out_g) → U54_gg(honor_in_ga(Y))
U53_gg(X, Y, integer_out_g) → U55_gg(X, Y, integer_in_g(Y))
\==_in_gg(X0, X1) → \==_out_gg
U44_gg(\==_out_gg) → higher_out_gg
integer_in_g(X0) → integer_out_g
U47_gg(X, Y, integer_out_g) → U48_gg(>=_in_gg(X, Y))
honor_in_ga(C) → U19_ga(face_card_in_ga(C))
honor_in_ga(C) → U20_ga(integer_in_g(C))
U50_gg(>_out_gg) → lower_out_gg
U52_gg(>_out_gg) → lower_out_gg
U54_gg(honor_out_ga(_M)) → lower_out_gg
U55_gg(X, Y, integer_out_g) → U56_gg(<_in_gg(X, Y))
U48_gg(>=_out_gg) → higher_out_gg
U19_ga(face_card_out_ga(N)) → honor_out_ga(N)
U20_ga(integer_out_g) → honor_out_ga(0)
>_in_gg(X0, X1) → >_out_gg
U56_gg(<_out_gg) → lower_out_gg
>=_in_gg(X0, X1) → >=_out_gg
face_card_in_ga(ace) → face_card_out_ga(4)
face_card_in_ga(king) → face_card_out_ga(3)
face_card_in_ga(queen) → face_card_out_ga(2)
face_card_in_ga(jack) → face_card_out_ga(1)
<_in_gg(X0, X1) → <_out_gg

The set Q consists of the following terms:

i_sort_in_gga(x0, x1)
U37_gga(x0, x1)
insert_in_gga(x0, x1)
U38_gga(x0)
U39_gga(x0, x1, x2, x3)
U40_gga(x0, x1, x2, x3)
higher_in_gg(x0, x1)
lower_in_gg(x0, x1)
U41_gga(x0, x1)
U42_gg(x0)
U43_gg(x0, x1)
U45_gg(x0)
U46_gg(x0, x1, x2)
U49_gg(x0)
U51_gg(x0)
U53_gg(x0, x1, x2)
\==_in_gg(x0, x1)
U44_gg(x0)
integer_in_g(x0)
U47_gg(x0, x1, x2)
honor_in_ga(x0)
U50_gg(x0)
U52_gg(x0)
U54_gg(x0)
U55_gg(x0, x1, x2)
U48_gg(x0)
U19_ga(x0)
U20_ga(x0)
>_in_gg(x0, x1)
U56_gg(x0)
>=_in_gg(x0, x1)
face_card_in_ga(x0)
<_in_gg(x0, x1)

We have to consider all (P,Q,R)-chains.

(42) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • SORT_SUITS_IN_GA(.(=(S, Ci), In)) → U35_GA(S, In, i_sort_in_gga(Ci, []))
    The graph contains the following edges 1 > 1, 1 > 2

  • U35_GA(S, In, i_sort_out_gga(Co)) → SORT_SUITS_IN_GA(In)
    The graph contains the following edges 2 >= 1

(43) YES

(44) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FILTER_IN_GGA(.(-(_A, X), In), Suit, Out) → U33_GGA(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
U33_GGA(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → FILTER_IN_GGA(In, Suit, Out)
FILTER_IN_GGA(.(-(Card, Suit), In), Suit, .(Card, Out)) → FILTER_IN_GGA(In, Suit, Out)

The TRS R consists of the following rules:

bid_in_gaaa(Hand, Attributes, Points, Bid) → U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_in_ga(Hand, SortedHand))
sort_hand_in_ga(Hand, SortedHand) → U26_ga(Hand, SortedHand, split_suits_in_ga(Hand, SplitHand))
split_suits_in_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), []))))) → U28_ga(Hand, S, H, D, C, filter_in_gga(Hand, spades, S))
filter_in_gga([], X12, []) → filter_out_gga([], X12, [])
filter_in_gga(.(-(Card, Suit), In), Suit, .(Card, Out)) → U32_gga(Card, Suit, In, Out, filter_in_gga(In, Suit, Out))
filter_in_gga(.(-(_A, X), In), Suit, Out) → U33_gga(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
\==_in_gg(X0, X1) → \==_out_gg(X0, X1)
U33_gga(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → U34_gga(_A, X, In, Suit, Out, filter_in_gga(In, Suit, Out))
U34_gga(_A, X, In, Suit, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(_A, X), In), Suit, Out)
U32_gga(Card, Suit, In, Out, filter_out_gga(In, Suit, Out)) → filter_out_gga(.(-(Card, Suit), In), Suit, .(Card, Out))
U28_ga(Hand, S, H, D, C, filter_out_gga(Hand, spades, S)) → U29_ga(Hand, S, H, D, C, filter_in_gga(Hand, hearts, H))
U29_ga(Hand, S, H, D, C, filter_out_gga(Hand, hearts, H)) → U30_ga(Hand, S, H, D, C, filter_in_gga(Hand, diamonds, D))
U30_ga(Hand, S, H, D, C, filter_out_gga(Hand, diamonds, D)) → U31_ga(Hand, S, H, D, C, filter_in_gga(Hand, clubs, C))
U31_ga(Hand, S, H, D, C, filter_out_gga(Hand, clubs, C)) → split_suits_out_ga(Hand, .(=(spades, S), .(=(hearts, H), .(=(diamonds, D), .(=(clubs, C), [])))))
U26_ga(Hand, SortedHand, split_suits_out_ga(Hand, SplitHand)) → U27_ga(Hand, SortedHand, sort_suits_in_ga(SplitHand, SortedHand))
sort_suits_in_ga([], []) → sort_suits_out_ga([], [])
sort_suits_in_ga(.(=(S, Ci), In), .(=(S, Co), Out)) → U35_ga(S, Ci, In, Co, Out, i_sort_in_gga(Ci, [], Co))
i_sort_in_gga([], L, L) → i_sort_out_gga([], L, L)
i_sort_in_gga(.(C1, Cn), Li, Lo) → U37_gga(C1, Cn, Li, Lo, insert_in_gga(C1, Li, Lt))
insert_in_gga(X, [], .(X, [])) → insert_out_gga(X, [], .(X, []))
insert_in_gga(X, .(Y, Z), .(X, .(Y, Z))) → U39_gga(X, Y, Z, higher_in_gg(X, Y))
higher_in_gg(ace, X13) → higher_out_gg(ace, X13)
higher_in_gg(king, X) → U42_gg(X, \==_in_gg(X, ace))
U42_gg(X, \==_out_gg(X, ace)) → higher_out_gg(king, X)
higher_in_gg(queen, X) → U43_gg(X, \==_in_gg(X, ace))
U43_gg(X, \==_out_gg(X, ace)) → U44_gg(X, \==_in_gg(X, king))
U44_gg(X, \==_out_gg(X, king)) → higher_out_gg(queen, X)
higher_in_gg(jack, X) → U45_gg(X, integer_in_g(X))
integer_in_g(X0) → integer_out_g(X0)
U45_gg(X, integer_out_g(X)) → higher_out_gg(jack, X)
higher_in_gg(jack, jack) → higher_out_gg(jack, jack)
higher_in_gg(X, Y) → U46_gg(X, Y, integer_in_g(X))
U46_gg(X, Y, integer_out_g(X)) → U47_gg(X, Y, integer_in_g(Y))
U47_gg(X, Y, integer_out_g(Y)) → U48_gg(X, Y, >=_in_gg(X, Y))
>=_in_gg(X0, X1) → >=_out_gg(X0, X1)
U48_gg(X, Y, >=_out_gg(X, Y)) → higher_out_gg(X, Y)
U39_gga(X, Y, Z, higher_out_gg(X, Y)) → insert_out_gga(X, .(Y, Z), .(X, .(Y, Z)))
insert_in_gga(X, .(Y, Z), .(Y, L)) → U40_gga(X, Y, Z, L, lower_in_gg(X, Y))
lower_in_gg(king, ace) → lower_out_gg(king, ace)
lower_in_gg(queen, X) → U49_gg(X, honor_in_ga(X, N))
honor_in_ga(C, N) → U19_ga(C, N, face_card_in_ga(C, N))
face_card_in_ga(ace, 4) → face_card_out_ga(ace, 4)
face_card_in_ga(king, 3) → face_card_out_ga(king, 3)
face_card_in_ga(queen, 2) → face_card_out_ga(queen, 2)
face_card_in_ga(jack, 1) → face_card_out_ga(jack, 1)
U19_ga(C, N, face_card_out_ga(C, N)) → honor_out_ga(C, N)
honor_in_ga(C, 0) → U20_ga(C, integer_in_g(C))
U20_ga(C, integer_out_g(C)) → honor_out_ga(C, 0)
U49_gg(X, honor_out_ga(X, N)) → U50_gg(X, >_in_gg(N, 2))
>_in_gg(X0, X1) → >_out_gg(X0, X1)
U50_gg(X, >_out_gg(N, 2)) → lower_out_gg(queen, X)
lower_in_gg(jack, X) → U51_gg(X, honor_in_ga(X, N))
U51_gg(X, honor_out_ga(X, N)) → U52_gg(X, >_in_gg(N, 1))
U52_gg(X, >_out_gg(N, 1)) → lower_out_gg(jack, X)
lower_in_gg(X, Y) → U53_gg(X, Y, integer_in_g(X))
U53_gg(X, Y, integer_out_g(X)) → U54_gg(X, Y, honor_in_ga(Y, _M))
U54_gg(X, Y, honor_out_ga(Y, _M)) → lower_out_gg(X, Y)
U53_gg(X, Y, integer_out_g(X)) → U55_gg(X, Y, integer_in_g(Y))
U55_gg(X, Y, integer_out_g(Y)) → U56_gg(X, Y, <_in_gg(X, Y))
<_in_gg(X0, X1) → <_out_gg(X0, X1)
U56_gg(X, Y, <_out_gg(X, Y)) → lower_out_gg(X, Y)
U40_gga(X, Y, Z, L, lower_out_gg(X, Y)) → U41_gga(X, Y, Z, L, insert_in_gga(X, Z, L))
U41_gga(X, Y, Z, L, insert_out_gga(X, Z, L)) → insert_out_gga(X, .(Y, Z), .(Y, L))
U37_gga(C1, Cn, Li, Lo, insert_out_gga(C1, Li, Lt)) → U38_gga(C1, Cn, Li, Lo, i_sort_in_gga(Cn, Lt, Lo))
U38_gga(C1, Cn, Li, Lo, i_sort_out_gga(Cn, Lt, Lo)) → i_sort_out_gga(.(C1, Cn), Li, Lo)
U35_ga(S, Ci, In, Co, Out, i_sort_out_gga(Ci, [], Co)) → U36_ga(S, Ci, In, Co, Out, sort_suits_in_ga(In, Out))
U36_ga(S, Ci, In, Co, Out, sort_suits_out_ga(In, Out)) → sort_suits_out_ga(.(=(S, Ci), In), .(=(S, Co), Out))
U27_ga(Hand, SortedHand, sort_suits_out_ga(SplitHand, SortedHand)) → sort_hand_out_ga(Hand, SortedHand)
U1_gaaa(Hand, Attributes, Points, Bid, sort_hand_out_ga(Hand, SortedHand)) → U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_in_gaa(SortedHand, Attributes, Points))
evaluate_in_gaa(Hand, [], P) → U4_gaa(Hand, P, hcp_in_gga(Hand, 0, HCP))
hcp_in_gga([], N, N) → hcp_out_gga([], N, N)
hcp_in_gga(.(=(_X, C), Sn), Ni, No) → U7_gga(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
hcp_suit_in_ga(S, P) → U10_ga(S, P, honors_in_gga(S, 0, HP))
honors_in_gga([], Pi, Pi) → honors_out_gga([], Pi, Pi)
honors_in_gga(.(C1, Cn), Pi, Po) → U14_gga(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gga(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gga(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gga(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gga(C1, Cn, Pi, Po, is_in_ag(Pt, +(P, Pi)))
is_in_ag(X0, X1) → is_out_ag(X0, X1)
U16_gga(C1, Cn, Pi, Po, is_out_ag(Pt, +(P, Pi))) → U17_gga(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa([], Pi, Pi) → honors_out_gaa([], Pi, Pi)
honors_in_gaa(.(C1, Cn), Pi, Po) → U14_gaa(C1, Cn, Pi, Po, honor_in_ga(C1, P))
U14_gaa(C1, Cn, Pi, Po, honor_out_ga(C1, P)) → U15_gaa(C1, Cn, Pi, Po, P, >_in_gg(P, 0))
U15_gaa(C1, Cn, Pi, Po, P, >_out_gg(P, 0)) → U16_gaa(C1, Cn, Pi, Po, is_in_aa(Pt, +(P, Pi)))
is_in_aa(X0, X1) → is_out_aa(X0, X1)
U16_gaa(C1, Cn, Pi, Po, is_out_aa(Pt, +(P, Pi))) → U17_gaa(C1, Cn, Pi, Po, honors_in_gaa(Cn, Pt, Po))
honors_in_gaa(.(C1, Cn), Pi, Pi) → U18_gaa(C1, Cn, Pi, honor_in_gg(C1, 0))
honor_in_gg(C, N) → U19_gg(C, N, face_card_in_gg(C, N))
face_card_in_gg(ace, 4) → face_card_out_gg(ace, 4)
face_card_in_gg(king, 3) → face_card_out_gg(king, 3)
face_card_in_gg(queen, 2) → face_card_out_gg(queen, 2)
face_card_in_gg(jack, 1) → face_card_out_gg(jack, 1)
U19_gg(C, N, face_card_out_gg(C, N)) → honor_out_gg(C, N)
honor_in_gg(C, 0) → U20_gg(C, integer_in_g(C))
U20_gg(C, integer_out_g(C)) → honor_out_gg(C, 0)
U18_gaa(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gaa(.(C1, Cn), Pi, Pi)
U17_gaa(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gaa(.(C1, Cn), Pi, Po)
U17_gga(C1, Cn, Pi, Po, honors_out_gaa(Cn, Pt, Po)) → honors_out_gga(.(C1, Cn), Pi, Po)
honors_in_gga(.(C1, Cn), Pi, Pi) → U18_gga(C1, Cn, Pi, honor_in_gg(C1, 0))
U18_gga(C1, Cn, Pi, honor_out_gg(C1, 0)) → honors_out_gga(.(C1, Cn), Pi, Pi)
U10_ga(S, P, honors_out_gga(S, 0, HP)) → U11_ga(S, P, HP, dist_in_ga(S, DP))
dist_in_ga([], 3) → dist_out_ga([], 3)
dist_in_ga(.(X2, []), 2) → dist_out_ga(.(X2, []), 2)
dist_in_ga(.(X3, .(X4, [])), 1) → dist_out_ga(.(X3, .(X4, [])), 1)
dist_in_ga(.(X5, .(X6, .(X7, X8))), 0) → dist_out_ga(.(X5, .(X6, .(X7, X8))), 0)
U11_ga(S, P, HP, dist_out_ga(S, DP)) → U12_ga(S, P, HP, DP, misc_in_ga(S, MP))
misc_in_ga(.(ace, []), -1) → misc_out_ga(.(ace, []), -1)
misc_in_ga(.(king, []), -2) → misc_out_ga(.(king, []), -2)
misc_in_ga(.(queen, .(X9, [])), -2) → misc_out_ga(.(queen, .(X9, [])), -2)
misc_in_ga(.(jack, .(X10, [])), -1) → misc_out_ga(.(jack, .(X10, [])), -1)
misc_in_ga(.(_X, .(_Y, .(H3, Rem))), P) → U21_ga(_X, _Y, H3, Rem, P, honor_in_ga(H3, X))
U21_ga(_X, _Y, H3, Rem, P, honor_out_ga(H3, X)) → U22_ga(_X, _Y, H3, Rem, P, >_in_gg(X, 0))
U22_ga(_X, _Y, H3, Rem, P, >_out_gg(X, 0)) → U23_ga(_X, _Y, H3, Rem, P, length_in_ga(Rem, N))
length_in_ga(X0, X1) → length_out_ga(X0, X1)
U23_ga(_X, _Y, H3, Rem, P, length_out_ga(Rem, N)) → U24_ga(_X, _Y, H3, Rem, P, N, >_in_ag(N, 2))
>_in_ag(X0, X1) → >_out_ag(X0, X1)
U24_ga(_X, _Y, H3, Rem, P, N, >_out_ag(N, 2)) → U25_ga(_X, _Y, H3, Rem, P, is_in_aa(P, -(N, 2)))
U25_ga(_X, _Y, H3, Rem, P, is_out_aa(P, -(N, 2))) → misc_out_ga(.(_X, .(_Y, .(H3, Rem))), P)
misc_in_ga(X11, 0) → misc_out_ga(X11, 0)
U12_ga(S, P, HP, DP, misc_out_ga(S, MP)) → U13_ga(S, P, is_in_aa(P, +(HP, +(DP, MP))))
U13_ga(S, P, is_out_aa(P, +(HP, +(DP, MP)))) → hcp_suit_out_ga(S, P)
U7_gga(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gga(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gga(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gga(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
hcp_in_gaa([], N, N) → hcp_out_gaa([], N, N)
hcp_in_gaa(.(=(_X, C), Sn), Ni, No) → U7_gaa(_X, C, Sn, Ni, No, hcp_suit_in_ga(C, N))
U7_gaa(_X, C, Sn, Ni, No, hcp_suit_out_ga(C, N)) → U8_gaa(_X, C, Sn, Ni, No, is_in_aa(Nt, +(N, Ni)))
U8_gaa(_X, C, Sn, Ni, No, is_out_aa(Nt, +(N, Ni))) → U9_gaa(_X, C, Sn, Ni, No, hcp_in_gaa(Sn, Nt, No))
U9_gaa(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gaa(.(=(_X, C), Sn), Ni, No)
U9_gga(_X, C, Sn, Ni, No, hcp_out_gaa(Sn, Nt, No)) → hcp_out_gga(.(=(_X, C), Sn), Ni, No)
U4_gaa(Hand, P, hcp_out_gga(Hand, 0, HCP)) → U5_gaa(Hand, P, HCP, adjustments_in_ga(Hand, MP))
adjustments_in_ga(X1, 0) → adjustments_out_ga(X1, 0)
U5_gaa(Hand, P, HCP, adjustments_out_ga(Hand, MP)) → U6_gaa(Hand, P, is_in_aa(P, +(HCP, MP)))
U6_gaa(Hand, P, is_out_aa(P, +(HCP, MP))) → evaluate_out_gaa(Hand, [], P)
U2_gaaa(Hand, Attributes, Points, Bid, SortedHand, evaluate_out_gaa(SortedHand, Attributes, Points)) → U3_gaaa(Hand, Attributes, Points, Bid, make_bid_in_ggaa(SortedHand, Attributes, Points, Bid))
make_bid_in_ggaa(Hand, Attributes, Points, 'punt...') → make_bid_out_ggaa(Hand, Attributes, Points, 'punt...')
U3_gaaa(Hand, Attributes, Points, Bid, make_bid_out_ggaa(SortedHand, Attributes, Points, Bid)) → bid_out_gaaa(Hand, Attributes, Points, Bid)

The argument filtering Pi contains the following mapping:
bid_in_gaaa(x1, x2, x3, x4)  =  bid_in_gaaa(x1)
U1_gaaa(x1, x2, x3, x4, x5)  =  U1_gaaa(x5)
sort_hand_in_ga(x1, x2)  =  sort_hand_in_ga(x1)
U26_ga(x1, x2, x3)  =  U26_ga(x3)
split_suits_in_ga(x1, x2)  =  split_suits_in_ga(x1)
U28_ga(x1, x2, x3, x4, x5, x6)  =  U28_ga(x1, x6)
filter_in_gga(x1, x2, x3)  =  filter_in_gga(x1, x2)
[]  =  []
filter_out_gga(x1, x2, x3)  =  filter_out_gga(x3)
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
U32_gga(x1, x2, x3, x4, x5)  =  U32_gga(x1, x5)
U33_gga(x1, x2, x3, x4, x5, x6)  =  U33_gga(x3, x4, x6)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
U34_gga(x1, x2, x3, x4, x5, x6)  =  U34_gga(x6)
spades  =  spades
U29_ga(x1, x2, x3, x4, x5, x6)  =  U29_ga(x1, x2, x6)
hearts  =  hearts
U30_ga(x1, x2, x3, x4, x5, x6)  =  U30_ga(x1, x2, x3, x6)
diamonds  =  diamonds
U31_ga(x1, x2, x3, x4, x5, x6)  =  U31_ga(x2, x3, x4, x6)
clubs  =  clubs
split_suits_out_ga(x1, x2)  =  split_suits_out_ga(x2)
U27_ga(x1, x2, x3)  =  U27_ga(x3)
sort_suits_in_ga(x1, x2)  =  sort_suits_in_ga(x1)
sort_suits_out_ga(x1, x2)  =  sort_suits_out_ga(x2)
=(x1, x2)  =  =(x1, x2)
U35_ga(x1, x2, x3, x4, x5, x6)  =  U35_ga(x1, x3, x6)
i_sort_in_gga(x1, x2, x3)  =  i_sort_in_gga(x1, x2)
i_sort_out_gga(x1, x2, x3)  =  i_sort_out_gga(x3)
U37_gga(x1, x2, x3, x4, x5)  =  U37_gga(x2, x5)
insert_in_gga(x1, x2, x3)  =  insert_in_gga(x1, x2)
insert_out_gga(x1, x2, x3)  =  insert_out_gga(x3)
U39_gga(x1, x2, x3, x4)  =  U39_gga(x1, x2, x3, x4)
higher_in_gg(x1, x2)  =  higher_in_gg(x1, x2)
ace  =  ace
higher_out_gg(x1, x2)  =  higher_out_gg
king  =  king
U42_gg(x1, x2)  =  U42_gg(x2)
queen  =  queen
U43_gg(x1, x2)  =  U43_gg(x1, x2)
U44_gg(x1, x2)  =  U44_gg(x2)
jack  =  jack
U45_gg(x1, x2)  =  U45_gg(x2)
integer_in_g(x1)  =  integer_in_g(x1)
integer_out_g(x1)  =  integer_out_g
U46_gg(x1, x2, x3)  =  U46_gg(x1, x2, x3)
U47_gg(x1, x2, x3)  =  U47_gg(x1, x2, x3)
U48_gg(x1, x2, x3)  =  U48_gg(x3)
>=_in_gg(x1, x2)  =  >=_in_gg(x1, x2)
>=_out_gg(x1, x2)  =  >=_out_gg
U40_gga(x1, x2, x3, x4, x5)  =  U40_gga(x1, x2, x3, x5)
lower_in_gg(x1, x2)  =  lower_in_gg(x1, x2)
lower_out_gg(x1, x2)  =  lower_out_gg
U49_gg(x1, x2)  =  U49_gg(x2)
honor_in_ga(x1, x2)  =  honor_in_ga(x1)
U19_ga(x1, x2, x3)  =  U19_ga(x3)
face_card_in_ga(x1, x2)  =  face_card_in_ga(x1)
face_card_out_ga(x1, x2)  =  face_card_out_ga(x2)
honor_out_ga(x1, x2)  =  honor_out_ga(x2)
U20_ga(x1, x2)  =  U20_ga(x2)
U50_gg(x1, x2)  =  U50_gg(x2)
>_in_gg(x1, x2)  =  >_in_gg(x1, x2)
>_out_gg(x1, x2)  =  >_out_gg
2  =  2
U51_gg(x1, x2)  =  U51_gg(x2)
U52_gg(x1, x2)  =  U52_gg(x2)
1  =  1
U53_gg(x1, x2, x3)  =  U53_gg(x1, x2, x3)
U54_gg(x1, x2, x3)  =  U54_gg(x3)
U55_gg(x1, x2, x3)  =  U55_gg(x1, x2, x3)
U56_gg(x1, x2, x3)  =  U56_gg(x3)
<_in_gg(x1, x2)  =  <_in_gg(x1, x2)
<_out_gg(x1, x2)  =  <_out_gg
U41_gga(x1, x2, x3, x4, x5)  =  U41_gga(x2, x5)
U38_gga(x1, x2, x3, x4, x5)  =  U38_gga(x5)
U36_ga(x1, x2, x3, x4, x5, x6)  =  U36_ga(x1, x4, x6)
sort_hand_out_ga(x1, x2)  =  sort_hand_out_ga(x2)
U2_gaaa(x1, x2, x3, x4, x5, x6)  =  U2_gaaa(x5, x6)
evaluate_in_gaa(x1, x2, x3)  =  evaluate_in_gaa(x1)
U4_gaa(x1, x2, x3)  =  U4_gaa(x1, x3)
hcp_in_gga(x1, x2, x3)  =  hcp_in_gga(x1, x2)
hcp_out_gga(x1, x2, x3)  =  hcp_out_gga
U7_gga(x1, x2, x3, x4, x5, x6)  =  U7_gga(x3, x6)
hcp_suit_in_ga(x1, x2)  =  hcp_suit_in_ga(x1)
U10_ga(x1, x2, x3)  =  U10_ga(x1, x3)
honors_in_gga(x1, x2, x3)  =  honors_in_gga(x1, x2)
honors_out_gga(x1, x2, x3)  =  honors_out_gga
U14_gga(x1, x2, x3, x4, x5)  =  U14_gga(x2, x3, x5)
U15_gga(x1, x2, x3, x4, x5, x6)  =  U15_gga(x2, x3, x5, x6)
0  =  0
U16_gga(x1, x2, x3, x4, x5)  =  U16_gga(x2, x5)
is_in_ag(x1, x2)  =  is_in_ag(x2)
is_out_ag(x1, x2)  =  is_out_ag
+(x1, x2)  =  +(x1, x2)
U17_gga(x1, x2, x3, x4, x5)  =  U17_gga(x5)
honors_in_gaa(x1, x2, x3)  =  honors_in_gaa(x1)
honors_out_gaa(x1, x2, x3)  =  honors_out_gaa
U14_gaa(x1, x2, x3, x4, x5)  =  U14_gaa(x2, x5)
U15_gaa(x1, x2, x3, x4, x5, x6)  =  U15_gaa(x2, x6)
U16_gaa(x1, x2, x3, x4, x5)  =  U16_gaa(x2, x5)
is_in_aa(x1, x2)  =  is_in_aa
is_out_aa(x1, x2)  =  is_out_aa
U17_gaa(x1, x2, x3, x4, x5)  =  U17_gaa(x5)
U18_gaa(x1, x2, x3, x4)  =  U18_gaa(x4)
honor_in_gg(x1, x2)  =  honor_in_gg(x1, x2)
U19_gg(x1, x2, x3)  =  U19_gg(x3)
face_card_in_gg(x1, x2)  =  face_card_in_gg(x1, x2)
4  =  4
face_card_out_gg(x1, x2)  =  face_card_out_gg
3  =  3
honor_out_gg(x1, x2)  =  honor_out_gg
U20_gg(x1, x2)  =  U20_gg(x2)
U18_gga(x1, x2, x3, x4)  =  U18_gga(x4)
U11_ga(x1, x2, x3, x4)  =  U11_ga(x1, x4)
dist_in_ga(x1, x2)  =  dist_in_ga(x1)
dist_out_ga(x1, x2)  =  dist_out_ga(x2)
U12_ga(x1, x2, x3, x4, x5)  =  U12_ga(x5)
misc_in_ga(x1, x2)  =  misc_in_ga(x1)
misc_out_ga(x1, x2)  =  misc_out_ga
U21_ga(x1, x2, x3, x4, x5, x6)  =  U21_ga(x4, x6)
U22_ga(x1, x2, x3, x4, x5, x6)  =  U22_ga(x4, x6)
U23_ga(x1, x2, x3, x4, x5, x6)  =  U23_ga(x6)
length_in_ga(x1, x2)  =  length_in_ga(x1)
length_out_ga(x1, x2)  =  length_out_ga
U24_ga(x1, x2, x3, x4, x5, x6, x7)  =  U24_ga(x7)
>_in_ag(x1, x2)  =  >_in_ag(x2)
>_out_ag(x1, x2)  =  >_out_ag
U25_ga(x1, x2, x3, x4, x5, x6)  =  U25_ga(x6)
U13_ga(x1, x2, x3)  =  U13_ga(x3)
hcp_suit_out_ga(x1, x2)  =  hcp_suit_out_ga
U8_gga(x1, x2, x3, x4, x5, x6)  =  U8_gga(x3, x6)
U9_gga(x1, x2, x3, x4, x5, x6)  =  U9_gga(x6)
hcp_in_gaa(x1, x2, x3)  =  hcp_in_gaa(x1)
hcp_out_gaa(x1, x2, x3)  =  hcp_out_gaa
U7_gaa(x1, x2, x3, x4, x5, x6)  =  U7_gaa(x3, x6)
U8_gaa(x1, x2, x3, x4, x5, x6)  =  U8_gaa(x3, x6)
U9_gaa(x1, x2, x3, x4, x5, x6)  =  U9_gaa(x6)
U5_gaa(x1, x2, x3, x4)  =  U5_gaa(x4)
adjustments_in_ga(x1, x2)  =  adjustments_in_ga(x1)
adjustments_out_ga(x1, x2)  =  adjustments_out_ga(x2)
U6_gaa(x1, x2, x3)  =  U6_gaa(x3)
evaluate_out_gaa(x1, x2, x3)  =  evaluate_out_gaa(x2)
U3_gaaa(x1, x2, x3, x4, x5)  =  U3_gaaa(x2, x5)
make_bid_in_ggaa(x1, x2, x3, x4)  =  make_bid_in_ggaa(x1, x2)
make_bid_out_ggaa(x1, x2, x3, x4)  =  make_bid_out_ggaa(x4)
bid_out_gaaa(x1, x2, x3, x4)  =  bid_out_gaaa(x2, x4)
FILTER_IN_GGA(x1, x2, x3)  =  FILTER_IN_GGA(x1, x2)
U33_GGA(x1, x2, x3, x4, x5, x6)  =  U33_GGA(x3, x4, x6)

We have to consider all (P,R,Pi)-chains

(45) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(46) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

FILTER_IN_GGA(.(-(_A, X), In), Suit, Out) → U33_GGA(_A, X, In, Suit, Out, \==_in_gg(Suit, X))
U33_GGA(_A, X, In, Suit, Out, \==_out_gg(Suit, X)) → FILTER_IN_GGA(In, Suit, Out)
FILTER_IN_GGA(.(-(Card, Suit), In), Suit, .(Card, Out)) → FILTER_IN_GGA(In, Suit, Out)

The TRS R consists of the following rules:

\==_in_gg(X0, X1) → \==_out_gg(X0, X1)

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
-(x1, x2)  =  -(x1, x2)
\==_in_gg(x1, x2)  =  \==_in_gg(x1, x2)
\==_out_gg(x1, x2)  =  \==_out_gg
FILTER_IN_GGA(x1, x2, x3)  =  FILTER_IN_GGA(x1, x2)
U33_GGA(x1, x2, x3, x4, x5, x6)  =  U33_GGA(x3, x4, x6)

We have to consider all (P,R,Pi)-chains

(47) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(48) Obligation:

Q DP problem:
The TRS P consists of the following rules:

FILTER_IN_GGA(.(-(_A, X), In), Suit) → U33_GGA(In, Suit, \==_in_gg(Suit, X))
U33_GGA(In, Suit, \==_out_gg) → FILTER_IN_GGA(In, Suit)
FILTER_IN_GGA(.(-(Card, Suit), In), Suit) → FILTER_IN_GGA(In, Suit)

The TRS R consists of the following rules:

\==_in_gg(X0, X1) → \==_out_gg

The set Q consists of the following terms:

\==_in_gg(x0, x1)

We have to consider all (P,Q,R)-chains.

(49) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • U33_GGA(In, Suit, \==_out_gg) → FILTER_IN_GGA(In, Suit)
    The graph contains the following edges 1 >= 1, 2 >= 2

  • FILTER_IN_GGA(.(-(Card, Suit), In), Suit) → FILTER_IN_GGA(In, Suit)
    The graph contains the following edges 1 > 1, 1 > 2, 2 >= 2

  • FILTER_IN_GGA(.(-(_A, X), In), Suit) → U33_GGA(In, Suit, \==_in_gg(Suit, X))
    The graph contains the following edges 1 > 1, 2 >= 2

(50) YES